如何实现图片左右循环滚动,请帮忙改一下代码!谢谢
<divid=mvpstyle=overflow:hidden;height:90;width:812;background:white;color:white><tab...
<div id=mvp style=overflow:hidden;height:90;width:812;background:white;color:white>
<table width="812" height="86" border=0 align=left cellpadding=0 cellspace=0>
<tr>
<td id=mvp1 valign=top><img src="uploadimg/news_2006720155859.gif" width="108" height="81"> <IMG height=81 src="guanggao/078.jpg" width=108
border=0> <IMG height=81 src="guanggao/087.jpg" width=108
border=0> <IMG height=81 src="guanggao/088.jpg" width=108
border=0> <img src="uploadimg/news_2004321231840.jpg" width="108" height="81"> <img src="uploadimg/03.jpg" width="108" height="81"> <img src="uploadimg/01.jpg" width="108" height="81"></td>
<td id=mvp2 valign=top></td>
</tr>
</table>
</div>
<script>
var speed=30
mvp2.innerHTML=mvp1.innerHTML
function Marquee(){
if(mvp2.offsetWidth-mvp.scrollLeft<=0)
mvp.scrollLeft-=mvp1.offsetWidth
else{
mvp.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
mvp.onmouseover=function() {clearInterval(MyMar)}
mvp.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
这是一段图片左右缝合滚动的代码,但是只能滚动两圈,不能循环滚动,有哪位高手能够实现循环滚动,谢谢! 展开
<table width="812" height="86" border=0 align=left cellpadding=0 cellspace=0>
<tr>
<td id=mvp1 valign=top><img src="uploadimg/news_2006720155859.gif" width="108" height="81"> <IMG height=81 src="guanggao/078.jpg" width=108
border=0> <IMG height=81 src="guanggao/087.jpg" width=108
border=0> <IMG height=81 src="guanggao/088.jpg" width=108
border=0> <img src="uploadimg/news_2004321231840.jpg" width="108" height="81"> <img src="uploadimg/03.jpg" width="108" height="81"> <img src="uploadimg/01.jpg" width="108" height="81"></td>
<td id=mvp2 valign=top></td>
</tr>
</table>
</div>
<script>
var speed=30
mvp2.innerHTML=mvp1.innerHTML
function Marquee(){
if(mvp2.offsetWidth-mvp.scrollLeft<=0)
mvp.scrollLeft-=mvp1.offsetWidth
else{
mvp.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
mvp.onmouseover=function() {clearInterval(MyMar)}
mvp.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
这是一段图片左右缝合滚动的代码,但是只能滚动两圈,不能循环滚动,有哪位高手能够实现循环滚动,谢谢! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询