网页不间断横向滚动图片代码
说明:请将下面的代码的图片换成你自己的图片地址。
<table width=700 border=0 cellpadding=0 cellspacing=0>
<tr><td>
<div id=demo style=overflow:hidden;height:120px;width:700px;color:#ff0000><table align=left cellpadding=0 cellspace=0 border=0><tr><td id=demo1 valign=top>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><a href=/javascript/showpage2443.htm target=_blank><img border=0 src=”/icon/BS9097.jpg” width=150 height=100 hspace=22></a><br><center><b>说明一</b></center></td>
<td width=30></td>
<td><a href= target=_blank><img border=0 src=”/icon/BS9092.jpg” width=150 height=100 hspace=22></a><br><center><b>说明二</b></center></td></td>
<td width=30></td>
<td><a href=http://www.3sdo.cn target=_blank><img border=0 src=”/icon/BS9084.jpg” width=150 height=100 hspace=22></a><br><center><b>说明三</b></center></td>
<td><a href=http://www.sanguo5.com target=_blank><img border=0 src=”/icon/BS9079.jpg” width=150 height=100 hspace=22></a><br><center><b>说明四</b></center></td>
<td width=30></td>
<td><a href=http://www.pc555.com target=_blank><img border=0 src=”/icon/BS9070.jpg” width=150 height=100 hspace=22></a><br><center><b>说明五</b></center></td>
</tr>
</table>
</td><td id=demo2 valign=top></td></tr></table></div>
<script>
var speed=10//速度数值越大速度越慢
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>