日期:2014-05-16  浏览次数:20297 次

请看一个图片滚动代码,为什么滚一会就停下来了?怎么改?
<div id="gundong" >
  <li class="gtitit"> <span>相片</span></li>
<table id="gun1">
<tr>
<td id="gundong1" valign="top"><table border="0" align="center" cellspacing="0" cellpadding="0">
<tr>

<td ><img src="flash/flash_images/201042222475813458.jpg" width="150px"; height="100px" /></td>
<td ><img src="flash/flash_images/201042222473859046.jpg" width="150px"; height="100px"/></td>
<td ><img src="flash/flash_images/201042222471621992.jpg" width="150px"; height="100px" /></td>
<td ><img src="flash/flash_images/20104222247452564.jpg" width="150px"; height="100px"/></td>
<td ><img src="flash/flash_images/20104222247128021.jpg" width="150px"; height="100px" /></td>
</tr>
</table></td>
<td id="gundong2" valign="top"></td>
</tr>
</table>
</div>

<SCRIPT>
var speed3=25;
var gundong1 = document.getElementById("gundong1"); 
var gundong2 = document.getElementById("gundong2");
var gundong = document.getElementById("gundong");
gundong2.innerHTML=gundong1.innerHTML;
function Marquee3(){
if(gundong2.offsetWidth-gundong.scrollLeft<=0)
gundong.scrollLeft-=gundong1.offsetWidth;
else{
gundong.scrollLeft++;
}
}
var MyMar3=setInterval(Marquee3,speed3)
gundong.onmouseover=function() {clearInterval(MyMar3)}
gundong.onmouseout=function() {MyMar3=setInterval(Marquee3,speed3)}
</SCRIPT>

------解决方案--------------------
gundong2 的问题~