<DIV id=demo style="OVERFLOW: hidden; WIDTH: 776px; HEIGHT: 100px"> <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD id=demo1 vAlign=center><IMG src="http://www.56rich.com/userlist/admin/data/userpic/2009123016940.jpg"> <IMG src="http://www.56rich.com/userlist/admin/data/userpic/2009123016159.jpg"> <IMG src="http://www.56rich.com/userlist/admin/data/userpic/2009123016247.jpg"> <IMG src="http://www.56rich.com/userlist/admin/data/userpic/2009123016238.jpg"> <IMG style="WIDTH: 139px; HEIGHT: 97px" height=198 src="http://www.56rich.com/userlist/admin/data/userpic/2009123016733.jpg" width=280> <IMG height=96 src="http://www.56rich.com/userlist/admin/data/userpic/2009123016702.jpg" width=136></TD> <TD id=demo2></TD></TR></TBODY></TABLE></DIV> <SCRIPT language=JavaScript type=text/javascript> <!-- var demo = document.getElementById("demo"); var demo1 = document.getElementById("demo1"); var demo2 = document.getElementById("demo2"); 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>
效果如下
|