Seamless scrolling of pictures

Source: Internet
Author: User

<style>#demo{Overflow:Hidden;Border:1px dashed #d8edff;width:900px;Height:132px;}#demo img{Border:2px solid #d8edff;}#demo1 a{float: Left;margin:10px;cursor:default;}#demo2 a{float: Left;margin:10px;}#indemo{width:800%;}</style><DivID= "Demo"><DivID= "Indemo"><DivID= "Demo1"><ahref="#"><imgsrc= "Img/hydra_index_pic1.png"Border= "0" /></a><ahref="#"><imgsrc= "Img/hydra_index_pic2.png"Border= "0" /></a><ahref="#"><imgsrc= "Img/hydra_index_pic3.png"Border= "0" /></a><ahref="#"><imgsrc= "Img/hydra_index_pic4.png"Border= "0" /></a><ahref="#"><imgsrc= "Img/hydra_index_pic5.png"Border= "0" /></a><ahref="#"><imgsrc= "Img/hydra_index_pic6.png"Border= "0" /></a></Div><DivID= "Demo2"></Div></Div></Div></Div><Script>//when using Div, make sure that Demo2 and demo1 are on the same line.var Speed= -//The higher the speed, the slower the speed.vartab2=document.getElementById ("Demo2");varTAB1=document.getElementById ("Demo1");varTab=document.getElementById ("Demo"); tab2.innerhtml=tab1.innerhtmlfunctionMarquee () {if(Tab2.offsetwidth-Tab.scrollleft<=0)//offsetwidth is the visible width of the objectTab.scrollleft-=Tab1.offsetwidth//ScrollWidth is the width of the actual content of the object, without wrapping the edgesElse{tab.scrollleft++}}varMyMar=setinterval (marquee,speed) tab.onmouseover=function() {clearinterval (MyMar)}tab.onmouseout=function() {MyMar=setinterval (marquee,speed)}</Script>

Today found that I wrote the picture scrolling code problems, although the picture can be recycled, but not continuous, the Internet to find out because Demo1 and Demo2 are used to float, so that they are not on the same line. After canceling the float, the picture is displayed on the same line as the second pass, and the workaround

#demo2 a{    float:left;    margin:10px;}

Seamless scrolling of pictures

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.