查看文章 |
兼容IE6,IE7的图片循环滚动,无间断图片滚动,JS图片滚动
2009-11-10 13:45
<div id="demo" style="overflow:hidden;width:754px; margin:0 auto;"> <table align="center" cellpadding="0" cellspacing="0" border="0"> <tr> <td id="demo1"><table width="98%" border="0" cellpadding="0" cellspacing="2"> <tr> <td><img src="" width="120" height="90" alt="a" /></td> <td><img src="" width="120" height="90" alt="b" /></td> <td><img src="" width="120" height="90" alt="c" /></td> <td><img src="" width="120" height="90" alt="d" /></td> <td><img src="" width="120" height="90" alt="e" /></td> <td><img src="" width="120" height="90" alt="f" /></td> <td><img src="" width="120" height="90" alt="g" /></td> <td><img src="" width="120" height="90" alt="h" /></td> <td><img src="" width="120" height="90" alt="i" /></td> <td><img src="" width="120" height="90" alt="j" /></td> <td><img src="" width="120" height="90" alt="k" /></td> <td><img src="" width="120" height="90" alt="l" /></td> <td><img src="" width="120" height="90" alt="m" /></td> <td><img src="" width="120" height="90" alt="n" /></td> <td><img src="" width="120" height="90" alt="o" /></td> </tr> </table></td> <td id="demo2"></td> </tr> </table> </div> <script language="JavaS var speed=20; demo2.innerHTML=demo1.innerHTML; //克隆demo1为demo2 function Marquee(){ if(demo2.offsetWidth <= demo.scrollLeft){ //当滚动至demo1与demo2交界时 demo.scrollLeft = demo.scrollLeft - demo1.offsetWidth; //demo跳到最顶端 } else{ demo.scrollLeft++; } } var MyMar=setInterval(Marquee,speed); //设置定时器 demo.on demo.on </script> |
最近读者: