//跟随方法比document.click不足之处:当出现cpu占用过高时,会出现跟随不上现象,导致此次点击并不能弹出窗口
var imgs = new Array("http://www.google.cn/intl/zh-CN/images/logo_cn.gif",
"http://hp.tom.com/images/logo.gif",
"http://img1.qq.com/news/pics/9499/9499744.gif",
"http://l.yimg.com/a/i/ww/beta/y3.gif",
"http://i3.sinaimg.cn/home/deco/2008/0325/sinahome_Logo.gif",
"http://cimg2.163.com/cnews/img/logo0202.gif",
"http://www.skycn.com/images/logo.gif",
"http://pics.taobao.com/bao/album/logo/logo200803.gif",
"http://pics.ebaystatic.com/aw/pics/logos/logoEbay_x45.gif",
"http://img.baidu.com/img/post-jg.gif",
"http://go.com/static/images/goredesign2006/clear.gif",
"http://logo.com/assets/topbanner/logotron.jpg",
"http://www.192.com/imgs/192.gif",
"http://10010.com/firm/images/logo_to.gif",
"http://10000.com/logo.gif",
"http://cn.yimg.com/i/realn/fp/reanalg.gif",
"http://tn1.cn3.yahoo.com/image/65d/1432ecbd693d111a3e.jpeg"
);
var flyTimer;
var topChange = 3;
var leftChange = 3;
var flyTop = parseInt(Math.random() * 500);
var flyLeft = parseInt(Math.random() * 900);function imgFly()
{
flyTop = flyImg.style.top = flyTop + parseInt(Math.random() * topChange);
flyLeft = flyImg.style.left = flyLeft + parseInt(Math.random() * leftChange);
if ( (flyLeft < 0) && (leftChange < 0))
{
leftChange = 3;
}else if ( (flyLeft > 900) && (leftChange > 0) )
{
leftChange = -3;
}
if ( (flyTop < 0) && (topChange < 0))
{
topChange = 3;
}else if ( (flyTop > 500) && (topChange > 0) )
{
topChange = -3;
}
flyTimer = setTimeout("imgFly()",50);
}document.write('<a href="http://www.qq.com" style="text-decoration: none;"><img id=flyImg src="' + imgs[parseInt(imgs.length * Math.random())] + '" style="border:0px;top:-100px; left:-100px; position:absolute;"></a>');
imgFly();
function document.onmousemove()
{
if (blankImg.style.display == "inline")
{
blankImg.style.top = event.clientY - 10;
blankImg.style.left = event.clientX-10;
}
}document.write('<a href="http://www.qidizi.com" target="_blank" style="text-decoration: none;"><img id=blankImg src="blank.gif" style="border:0px;top:-100px; left:-100px; position:absolute; display:inline;" οnclick="this.style.display=/'none/';"></a>');
blankImg.setCapture(true);
标签:leftChange,http,鼠标,gif,ie,测试通过,var,logo,com From: https://blog.51cto.com/u_252283/6235725