飓风
查看飓风的博客
金钱 | : 2778 |
Level | : 0 |
发帖数 | : 456 |
最后登陆 | : 2013/5/14 |
注册时间 | : 2005/10/24 |
|
图片滚动代码 [横的] -------------------------------------------------------------------------------------------------------------- <div id=demo style=overflow:hidden;height:120;width:600;color:#ffffff><table align=left cellpadding=0 cellspace=0 border=0><tr><td id=demo1 valign=top> <table border=0 cellpadding=0 cellspacing=0> <tr> <td><img src=jsimg/1.jpg width=150 height=100></td> <td><img src=jsimg/2.jpg width=150 height=100></td> <td><img src=jsimg/3.jpg width=150 height=100></td> <td><img src=jsimg/4.jpg width=150 height=100 ></td> <td><img src=jsimg/5.jpg width=150 height=100></td> </tr> </table> </td><td id=demo2 valign=top></td></tr></table></div> <script> var speed=10//速度数值越大速度越慢 demo2.innerHTML=demo1.innerHTML function Marquee(){ if(demo2.offsetWidth-demo.scrollLeft<=0) demo.scrollLeft-=demo1.offsetWidth else{ demo.scrollLeft++ } } var MyMar=setInterval(Marquee,speed) demo.onmouseover=function() {clearInterval(MyMar)} demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)} </script> ------------------------------------------------------------------------------------------------------------ [竖直的] <DIV id=demo style="BACKGROUND: #ffffff; OVERFLOW: hidden; WIDTH: 150px; COLOR: #0000ff; HEIGHT: 500px"> <DIV id=demo1> <div align="center"> /<A href="http://www.google.com" target=_blank><IMG src="http://127.0.0.1/uploadfiles/2005-12/20051211532359.jpg" border=0></A><br> <A href="http://www.google.com" target=_blank><IMG src="http://127.0.0.1/uploadfiles/2005-11/2005113093040254.jpg" border=0></A><br> <A href="http://www.google.com" target=_blank><IMG src="http://127.0.0.1/uploadfiles/2005-11/2005113093040254.jpg" border=0></A><br> </div> </DIV> <DIV id=demo2></DIV> </DIV> <SCRIPT language="javascript"> var speed=10; 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>
|