日期:2014-05-17 浏览次数:20615 次
<div id="demo"> <div id="demo1"> <table> <tr> <td><img align="middle" src="gift_move_2007.gif"> </td> <td><img align="middle" src="gift_move_2007.gif"> </td> <td><img align="middle" src="gift_move_2007.gif"> </td> </tr> <tr> <td><img align="middle" src="http://www.mcr-motorola.com/incentive2008/images/yuanzhuang_trbo.gif"> </td> <td><img align="middle" src="http://www.mcr-motorola.com/incentive2008/images/yuanzhuang_trbo.gif"> </td> <td><img align="middle" src="http://www.mcr-motorola.com/incentive2008/images/yuanzhuang_trbo.gif"> </td> </tr> </table> </div> <div id="demo2"></div> </div> <script> <!-- var speed=10; //数字越大速度越慢 var tab=document.getElementById("demo"); var tab1=document.getElementById("demo1"); var tab2=document.getElementById("demo2"); tab2.innerHTML=tab1.innerHTML; function Marquee(){ if(tab2.offsetTop-tab.scrollTop<=0)//当滚动至demo1与demo2交界时 { tab.scrollTop-=tab1.offsetHeight //demo跳到最顶端 } else{ tab.scrollTop++ } } var MyMar=setInterval(Marquee,speed); tab.onmouseover=function() {clearInterval(MyMar)};//mouseover时清除定时器达到滚动停止的目的 tab.onmouseout=function() {MyMar=setInterval(Marquee,speed)};//mouseout时重设定时器 --> </script>
------解决方案--------------------
上面的测试通过,
祝楼主好运!
------解决方案--------------------
貌似滚动都是这样的
就象屋子之前空的,然后你搞了一队人走进去,如果之前屋子是满的,一队人怎么走进去?
------解决方案--------------------
用marquee可不可以现实呢?
------解决方案--------------------
要无缝滚动?
http://www.cnblogs.com/cloudgamer/archive/2008/04/30/1177682.html