首页
微信
安卓
接口
移动
前端
专题
文档库
工具
网址
§
ITPOW
>>
文档
>>
JavaScript
>>
媒体图像
页面上飘来飘去的图片
作者:chilleen 来源:
ITPOW
日期:2004-9-30
<div id="ad" style="position:absolute;"> <img id="img" src="http://www.itpow.com/images/cftea.gif"> </div> <script> stepX=10; stepY=20; imgWidth=document.all.img.width; imgHeight=document.all.img.height; function move() { if(document.all.ad.style.pixelLeft>(document.body.scrollLeft+document.body.clientWidth-imgWidth)) stepX=-stepX; else if(document.all.ad.style.pixelLeft<document.body.scrollLeft) stepX=-stepX; else if(document.all.ad.style.pixelTop>(document.body.scrollTop+document.body.clientHeight-imgHeight)) stepY=-stepY; else if(document.all.ad.style.pixelTop<document.body.scrollTop) stepY=-stepY; document.all.ad.style.pixelLeft+=stepX; document.all.ad.style.pixelTop+=stepY; setTimeout("move()",100); } move(); </script>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
相关文章
创建于2005年
渝ICP备05010272号-1
电邮:
cftea@126.com
即将跳转...