<HTML> <HEAD> <TITLE>Mouse Stoker</TITLE> <SCRIPT TYPE="text/javascript"> <!-- //最初の位置 var x=200; var y=12; function ctrlMove(){ var moveByX; var moveByY; var LEFT_MIN = document.body.scrollLeft; var LEFT_MAX = document.body.clientWidth + document.body.scrollLeft; var TOP_MIN = document.body.scrollTop; var TOP_MAX = document.body.clientHeight + document.body.scrollTop; moveByX = calcProc(x,LEFT_MIN,LEFT_MAX); x+=moveByX; moveByY = calcProc(y,TOP_MIN,TOP_MAX); y+=moveByY; moveByLayer("mouse",moveByX,moveByY); } function calcProc(baseNum,intMin,intMax){ var retRnd; var result; retRnd = Math.floor(Math.random() * 3 + 1); result = retRnd * 80; retRnd = Math.random(); if(retRnd > 0.5){ result*=-1; } if(baseNum+result < intMin){ result = result * -1; } if(baseNum+result > intMax){ result = result * -1; } return result ; } function moveByLayer(idName,x,y){ if(document.getElementById){ var obj = document.getElementById(idName).style; obj.left = ( parseInt(obj.left) + x ) + 'px'; obj.top = ( parseInt(obj.top) + y ) + 'px'; }else if(document.all){ document.all(idName).style.pixelLeft += x; document.all(idName).style.pixelTop += y; }else if(document.layers){ document.layers[idName].moveBy(x,y); } } //--> </SCRIPT> </HEAD> <BODY> <DIV ID="mouse" onMouseOver="ctrlMove()" STYLE="position:absolute;; width: 24; height: 32; left: 464px; top: 18px"> <A HREF="javascript:alert('Get’s')"><IMG SRC="image/click1.gif" WIDTH="24" HEIGHT="32" BORDER="0"></A> </DIV> |