图片无缝滚动总是停止,为什么啊
<script type="text/javascript">function Scrollup(){
var speed1=30;
var colee2=document.getElementById("colee2");
var colee1=document.getElementById("colee1");
var colee=document.getElementById("colee");
colee2.innerHTML=colee1.innerHTML; //克隆colee1为colee2
function Marquee1(){
//当滚动至colee1与colee2交界时
if(colee2.offsetTop-colee.scrollTop<=0){
colee.scrollTop-=colee1.offsetHeight; //colee跳到最顶端
}else{
colee.scrollTop++
}
}
var MyMar1=setInterval(Marquee1,speed1)//设置定时器
//鼠标移上时清除定时器达到滚动停止的目的
colee.onmouseover=function() {clearInterval(MyMar1)}
//鼠标移开时重设定时器
colee.onmouseout=function(){MyMar1=setInterval(Marquee1,speed1)}
}
</script>
<div class="yb" style="border:1px solid #6db53d;" >
<DIV class="lanpic"><IMG alt="新闻大事记" src="./image/btl16.jpg" width=480 height=29></DIV>
<div id="colee" align="center" style="overflow:hidden;height:335px;width:470px;">
<div id="colee1">
<p><img src="./image/fhtz.png"></p>
</div>
<div id="colee2"></div>
</div>
<script type="text/javascript"> Scrollup();</script>
</div>
</div>
想实现从下往上滚动,可是放进去的图片,滚动两遍就停了,怕设置的滚动框高度不合适,又改了几次div id="colee" align="center" style="overflow:hidden;height:335px;width:470px;">这个代码中的高度,改了好几次,还是一样,滚动2遍就停了,不知原因,求解?