header("Content-type:text/html;charset=utf-8");
?>
*{margin:0;padding:0;border:0;}
#myCanvas{
}
Your browser does not support the HTML5 canvas tag.
//画鼠标为交叉点的十字
function dh(x,y){
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.canvas.width = window.innerWidth;
ctx.canvas.height = window.innerHeight;
ctx.lineWidth = 1;
ctx.strokeStyle = 'rgba(0,0,255,1)';
ctx.clearRect(0,0,2000,1000);
ctx.beginPath();
ctx.moveTo(x-0.5,0);
ctx.lineTo(x-0.5,y-40.5);
ctx.moveTo(x-0.5,y+40.5);
ctx.lineTo(x-0.5,1000);
ctx.moveTo(0,y-0.5);
ctx.lineTo(x-40.5,y-0.5);
ctx.moveTo(x+40.5,y-0.5);
ctx.lineTo(2000.5,y-0.5);
ctx.rect(x-40.5,y-40.5,81,81);
ctx.stroke();
}
/* document.onmousemove=function(e){
e=e||window.event;
var x=e.clientX,y=e.clientY;
setTimeout(function(){
dh(x,y);
},20)
} */
function e(){
dh(Math.round(Math.random()*window.innerWidth),Math.round(Math.random()*window.innerHeight));
}
window.setInterval(e,Math.round(Math.random()*2000)+2000);