四种不同方式marquee图片不间断循环滚动代码
时间:2010-10-21 来源:水温刚好
向右:
<base
href="http://image2.sina.com.cn/gm/lineage2/whz/newwh/images/fy/images/images/ifimage/">
<div id=demo style="overflow:hidden;width:300px;"><table align=left
cellpadding=0 cellspace=0 border=0><tr><td id=demo1 valign=top><img src="http://www.cnblogs.com/gfjs.gif"><img
src="http://www.cnblogs.com/bxtt.gif"><img src="http://www.cnblogs.com/bzjd.gif"><img src="http://www.cnblogs.com/gfjs.gif"><img src="http://www.cnblogs.com/bxtt.gif"><img
src="http://www.cnblogs.com/bzjd.gif"></td><td id=demo2 valign=top></td></tr></table></div>
<script>
var speed=30
demo2.innerHTML=demo1.innerHTML
demo.scrollLeft=demo.scrollWidth
function Marquee(){
if(demo.scrollLeft<=0)
demo.scrollLeft+=demo2.offsetWidth
else{
demo.scrollLeft--
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>