Transferred from: http://www.codefans.net/jscss/code/255.shtml
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">#demo {background: #FFF; overflow:hidden;border:1px dashed #CCC; width:500px;} #demo img {border:3px solid #F2F2F2;} #indemo {float: left;width:800%;} #demo1 {float: Left;} #demo2 {float: Left;}--></style><div id= "Demo" ><div id= "Indemo" ><div id= "demo1" ><a href= "#" ></a><a href= "#" ></a><a href= "#" ></a>< A href= "#" ></a><a href= "#" ></a><a href=" # "></a></div><div id= "Demo2" ></div></div></div><script> <!--varspeed=10;varTab=document.getelementbyid ("Demo");varTab1=document.getelementbyid ("Demo1");varTab2=document.getelementbyid ("Demo2"); tab2.innerhtml=tab1.innerhtml;functionMarquee () {if(tab2.offsetwidth-tab.scrollleft<=0) Tab.scrollleft-=Tab1.offsetwidthElse{tab.scrollleft++;}}varMymar=setinterval (marquee,speed); Tab.onmouseover=function() {clearinterval (MyMar)};tab.onmouseout=function() {mymar=setinterval (Marquee,speed)};--></script></body>View Code