看看这段滚动图片的代码错在哪里?谢谢!
看看这段滚动图片的代码,div的宽度超过200px后图片就不滚动了,但是200px以下任意修改宽度都可以连续滚动,不知是什么原因,请各位帮忙给看看,谢谢!
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="131">
<DIV id=demo style="OVERFLOW: hidden; WIDTH: 199px; HEIGHT: 140px">
<table width="320" border=0 align=left cellpadding=0
cellspace="0">
<tbody>
<tr>
<td width="18" valign=top id=demo1>
<%
call ShowPicArticle_index(0,3,16,1,1,179,136,200,false,false) '图片新闻向上滚动显示(滚动无空白)
%></td>
<td width="100%"
valign=top id=demo2></td>
</tr>
</tbody>
</table>
</div></td>
</tr>
</table>
<script>
var speed=15
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script> </td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="131">
<DIV id=demo style="OVERFLOW: hidden; WIDTH: 199px; HEIGHT: 140px">
<table width="320" border=0 align=left cellpadding=0
cellspace="0">
<tbody>
<tr>
<td width="18" valign=top id=demo1>
<%
call ShowPicArticle_index(0,3,16,1,1,179,136,200,false,false) '图片新闻向上滚动显示(滚动无空白)
%></td>
<td width="100%"
valign=top id=demo2></td>
</tr>
</tbody>
</table>
</div></td>
</tr>
</table>
<script>
var speed=15
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script> </td>
</tr>
</table></td>
</tr>
</table>