标题:
[
JavaScript
]
不间断滚动图片
[打印本页]
作者:
shillan
时间:
2006-11-14 23:22
标题:
不间断滚动图片
加入如下代码到body区域
<div id=demo style=overflow:hidden;height:200;width:150> <div id=demo1> <img src='17/1.jpg'><br> <img src='17/2.jpg'><br> <img src='17/3.jpg'><br> <img src='17/4.jpg'><br> <img src='17/5.jpg'><br> </div> <div id=demo2></div> </div> <script> var speed=30; demo2.innerhtml=demo1.innerhtml function marquee() { if(demo2.offsettop-demo.scrolltop<=0) demo.scrolltop-=demo1.offsetheight; else demo.scrolltop++; } var mymar=setinterval(marquee,speed) demo.onmouseover=function() {clearinterval(mymar)} demo.onmouseout=function() {mymar=setinterval(marquee,speed)} </script>
欢迎光临 逐梦论坛 (http://temp2023.zhumeng.org/)
Powered by Discuz! 7.2