<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="gbk" />
<title>到处乱飘的广告</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>
<body>
<div id="piaofu" style="position:absolute; border:0px solid #ccc;">
<div style="text-align:right;">
<a href="javascript:void(0)" onclick="javascript:closePiaofu()" style="background-color: #A00;color:#fff; padding:0px 5px; text-decoration:none; font-size:12px;">[关闭]</a>
</div>
<a href="http://www.web100.cc" target="_blank" style="">
<img src="http://www.web100.cc/webui/images/logo.png" border="0" width="315" height="81" />
</a>
</div>
<script>
function closePiaofu(){
document.getElementById("piaofu").style.display = "none";
}
var x = 50,y = 160;
var xin = true, yin = true;
var step = 0.8;
var delay = 10;
var obj=document.getElementById("piaofu");
function piaofu(){
var L=T=0
var R = document.body.clientWidth-obj.offsetWidth;
var B = document.body.clientHeight-obj.offsetHeight;
obj.style.left = x + document.body.scrollLeft;
obj.style.top = y + document.body.scrollTop;
x = x + step*(xin?1:-1)
if (x < L){ xin = true; x = L;}
if (x > R){ xin = false; x = R;}
y = y + step*(yin?1:-1);
if (y < T) { yin = true; y = T; }
if (y > B) { yin = false; y = B; }
}
var itl = setInterval("piaofu()", delay);
obj.onmouseover=function(){clearInterval(itl)}
obj.onmouseout=function(){itl=setInterval("piaofu()", delay)}
</script>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
<p>
</body>
</html>
要饭二维码
洪哥写文章很苦逼,如果本文对您略有帮助,可以扫描下方二维码支持洪哥!金额随意,先行谢过!大家的支持是我前进的动力!
文章的版权
本文属于“洪哥笔记”原创文章,转载请注明来源地址:到处乱飘的飘浮广告:http://www.splaybow.com/post/piaofu-guanggao-js.html
如果您在服务器运维、网络管理、网站或系统开发过程有需要提供收费服务,请加QQ:8771947!十年运维经验,帮您省钱、让您放心!
亲,如果有需要,先存起来,方便以后再看啊!加入收藏夹的话,按Ctrl+D!
发布时间:2015/8/12 8:02:53 | 编辑:洪哥 | 分类:DHTML | 浏览: