如何修改以下语句,实现滚动图片的首尾相接?

来源:百度知道 编辑:UC知道 时间:2024/06/14 08:37:42
请问如何修改以下语句,实现滚动图片的首尾相接?

<marquee direction="left" behavior="scroll" scrollamount="2" scrolldelay="100" onmouseover="this.stop()" onmouseout="this.start()" width="900">
<marquee direction="left" behavior="scroll" scrollamount="2" scrolldelay="100" onmouseover="this.stop()" onmouseout="this.start()" width="900"><asp:Label id="picture" runat="server"></asp:Label></marquee>

需要用JS才能实现。

例:(把图片地址改成你的就OK了。)
<div id=demo style=overflow:hidden;height:150;width:460; bgcolor="#FEE8C1";>
<table align=left cellpadding=0 cellspace=0 border=0 >
<tr><td id=demo1 valign=top bgcolor=#FEE8C1><IMG height=100
src="images/1.jpg"
width=160><IMG height=100
src="images/2.jpg"
width=150><IMG height=100
src="images/3.jpg"
width=150><IMG height=100
src="images/4.jpg"
width=150>
</td>
<td id=demo2 valign=top></td>
</tr>
</table>
</div>
<script>
var speed=30
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