Home >Web Front-end >HTML Tutorial >div image marquee seamless connection implementation code_HTML/Xhtml_web page production

div image marquee seamless connection implementation code_HTML/Xhtml_web page production

WBOY
WBOYOriginal
2016-05-16 16:38:501502browse

Copy code
The code is as follows:







Image seamlessly scrolls to the left
Scrolls to the left

Copy the code
The code is as follows:






your number


hello



idiot


stupid








<script> <br><!-- <br />var speed=10; //The larger the number, the slower the speed <br />var tab=document.getElementById("demo"); <br />var tab1=document.getElementById("demo1"); <br />var tab2=document.getElementById("demo2"); <br />tab2.innerHTML=tab1.innerHTML; <br />function Marquee(){ <br />if( tab2.offsetWidth-tab.scrollLeft<=0) <br />tab.scrollLeft-=tab1.offsetWidth <br />else{ <br />tab.scrollLeft ; <br />} <br />} <br />var MyMar=setInterval( Marquee,speed); <br />tab.onmouseover=function() {clearInterval(MyMar)}; <br />tab.onmouseout=function() {MyMar=setInterval(Marquee,speed)}; <br />--> <br></script>


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn