带关闭功能的网页漂浮广告特效代码展示 dn001 2009-06-21 08:55:19 <!-- bbs http://www.knowsky.com/bbs--> <!- 把下列代码加到<body>区域内 --> <div id=demo style=overflow:hidden;height:200;width:150> <div id=demo1> <img src='/img/200406301.jpg'><br> <img src='/img/200406302.jpg'><br> <img src='/img/200406303.jpg'><br> <img src='/img/200406304.jpg'><br> <img src='/img/200406305.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> </body>