$(document).ready(function (){
width = window.innerWidth;
height = window.innerHeight;
canvas = document.getElementById('myCanv');
canvas.width = width;
canvas.height = height;
var c=document.getElementById("myCanv");
var canv=c.getContext("2d");
canv.fill;
canv.beginPath();
var h = 20;
var y = 0;
function draw() {
if (y < canvas.height/2) {
canv.fillRect(170,y,15,1);
canv.clearRect(170,y-15,15,1);
y++;
};
if (y >= canvas.height/2) {
canv.clearRect(170,y+21,15,1);
y++;
};
if ( h < canvas.height/2) {
canv.arc(70,h,15,0,Math.PI*2,true);
h++;
};
};
canv.closePath();
canv.fill();
setInterval(draw,15);
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
认证高级PHP讲师