js文字无缝滚动

 1 <div id=demo style="overflow:hidden; 128px; height:300px;"> 
 2 <div id=demo1> 
 3   <table width="90%" cellspacing="3" cellpadding="0" border="0" align="center"><tbody><tr><td class="ykxm">孙君洲&nbsp;</td><td>1人</td><td>&nbsp;2013-09-06到</td><td class="xdd"><font color="#FF0000">新订单</font></td></tr><tr><td class="ykxm">冀先生&nbsp;</td><td>12人</td><td>&nbsp;2013-08-25到</td><td class="ycldd"><font color="#009900">已确认</font></td></tr><tr><td class="ykxm">李璐婵&nbsp;</td><td>3人</td><td>&nbsp;2013-09-10到</td><td class="ycldd"><font color="#009900">已确认</font></td></tr><tr><td class="ykxm">徐澜&nbsp;</td><td>2人</td><td>&nbsp;2013-08-26到</td><td class="ycldd"><font color="#009900">已确认</font></td></tr><tr><td class="ykxm">周益毅&nbsp;</td><td>2人</td><td>&nbsp;2013-08-27到</td><td class="ycldd"><font color="#009900">已确认</font></td></tr><tr><td class="ykxm">林思颖&nbsp;</td><td>2人</td><td>&nbsp;2013-08-24到</td><td class="ycldd"><font color="#009900">已确认</font></td></tr><tr><td class="ykxm">赵志礼&nbsp;</td><td>3人</td><td>&nbsp;2013-08-30到</td><td class="ycldd"><font color="#009900">已确认</font></td></tr><tr><td class="ykxm">郑朝海&nbsp;</td><td>3人</td><td>&nbsp;2013-08-22到</td><td class="ycldd"><font color="#009900">已确认</font></td></tr><tr><td class="ykxm">黄生&nbsp;</td><td>3人</td><td>&nbsp;2013-08-22到</td><td class="ycldd"><font color="#009900">已确认</font></td></tr><tr><td class="ykxm">蒲先生&nbsp;</td><td>5人</td><td>&nbsp;2014-08-01到</td><td class="ycldd"><font color="#009900">已确认</font></td></tr><tr><td class="ykxm">杨虞&nbsp;</td><td>4人</td><td>&nbsp;2013-09-22到</td><td class="ycldd"><font color="#009900">已确认</font></td></tr><tr><td class="ykxm">恽小姐&nbsp;</td><td>3人</td><td>&nbsp;2014-06-21到</td><td class="ycldd"><font color="#009900">已确认</font></td></tr></tbody></table>
 4 </div> 
 5 <div id=demo2></div> 
 6 </div> 
 7 <script language="javascript"> 
 8 var speed=30 
 9 demo2.innerHTML=demo1.innerHTML 
10 function Marquee(){ 
11 if(demo2.offsetTop-demo.scrollTop<=0) 
12 demo.scrollTop-=demo1.offsetHeight 
13 else{ 
14 demo.scrollTop++ 
15 } 
16 } 
17 var MyMar=setInterval(Marquee,speed) 
18 demo.onmouseover=function() {clearInterval(MyMar)} 
19 demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)} 
20 </script> 


   本人博客的文章大部分来自网络转载,因为时间的关系,没有写明转载出处和作者。所以在些郑重的说明:文章只限交流,版权归作者。谢谢

原文地址:https://www.cnblogs.com/wzg0319/p/3272434.html