1 <HTMLxmlns= "http://www.w3.org/1999/xhtml">2 <Head>3 <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" />4 <title>Picture scrolling</title>5 </Head>6 <Body>7 <styletype= "Text/css">8 <!--9 *{Ten margin:0px; One padding:0px; A Border:0px; - } - #demo{ the background:#FFF; - Overflow:Hidden; - Border:1px dashed #CCC; - width:500px; + margin:300px Auto; - padding:20px 0; + } A #demo img{ at Border:3px Solid #c8c8c8; - } - #indemo{ - float: Left; - width:800%; - } in #demo1{ - float: Left; to } + #demo2{ - float: Left; the } * - $ </style>Panax Notoginseng <DivID= "Demo"> - <DivID= "Indemo"> the <DivID= "Demo1"> + <ahref="#"><imgsrc= "2.png"Border= "0" /></a> A <ahref="#"><imgsrc= "2.png"Border= "0" /></a> the </Div> + <DivID= "Demo2"></Div> - </Div> $ </Div> $ <Scripttype= "Text/javascript"src= "Http://apps.bdimg.com/libs/jquery/2.1.4/jquery.js"></Script> - <Scripttype= "Text/javascript"> - var Speed= -, the Fu=document.getElementById ("Demo"), - Child1=document.getElementById ("Demo1"),Wuyi child2=document.getElementById ("Demo2"); the child2.innerhtml=child1.innerhtml; - Wu varMarquee= function() { - if(Child2.offsetwidth-Fu.scrollleft<= 0) { About Fu.scrollleft-=Fu.offsetwidth; $ } Else { - Fu.scrollleft++; - } - }; A varInter=setinterval (marquee, speed); + the Fu.onmouseover= function() { - Clearinterval (inter); $ }; the the Fu.onmouseout= function() { the Inter=setinterval (marquee, speed); the }; - </Script> in </Body> the </HTML>
No interval marquee scrolling