aa实现内容滚动时首尾相连,不出现空白的时候

<HTML>
<HEAD>
</HEAD>
<BODY>



<div id=demo style='overflow:hidden;height:32px;width:809px;'>
<table height='' border=1 cellspacing=0 cellpadding=0>
<td id=demo1>
<!--   下面是你要显示的内容   -->
<table width=809>
<tr>
<td>1</td><td>2</td><td>3</td><td>3</td><td>3</td><td>3</td><td>3</td><td>3</td><td>3</td><td>3</td>
</tr>
</table>
            <!--   显示的内容结束!   -->
</td>
<td id=demo2></td>

</table>
</div>


<script>

 var speed=15; //移动速度
 demo2.innerHTML=demo1.innerHTML;
 function Marquee1(){
    if(demo2.offsetWidth-demo.scrollLeft <=0){
		demo.scrollLeft-=demo2.offsetWidth;
	}else{
		demo.scrollLeft++;
    }
 }
 var MyMar=setInterval(Marquee1,speed);
 demo.onmouseover=function(){clearInterval(MyMar)}
 demo.onmouseout=function(){MyMar=setInterval(Marquee1,speed)}
</script>
</td>
    </tr>

</BODY>
</HTML>


你可能感兴趣的:(实现)