Div+css+js continuous horizontal scrolling to achieve code _javascript skills

Source: Internet
Author: User
Div+css+js to achieve uninterrupted horizontal scrolling code
Copy Code code as follows:

<! DOCTYPE html>


<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Horizontal continuous scrolling div CSS Code-divcss5</title>

<body>
<style>
. scroll_div {width:600px; height:49px;margin:0 auto; overflow:hidden; white-space:nowrap; background: #ffffff;}
. scroll_div img {width:120px;height:49px;border:0;margin:auto 8px;}
#scroll_begin, #scroll_end, #scroll_begin ul, #scroll_end ul, #scroll_begin ul Li, #scroll_end ul Li{display:inline;} /* Set UL and Li-Yoko * *
</style>
<script language= "JavaScript" >
function Scrollimgleft () {
var speed=20
var scroll_begin = document.getElementById ("Scroll_begin");
var scroll_end = document.getElementById ("Scroll_end");
var scroll_div = document.getElementById ("Scroll_div");
Scroll_end.innerhtml=scroll_begin.innerhtml
function Marquee () {
if (scroll_end.offsetwidth-scroll_div.scrollleft<=0)
Scroll_div.scrollleft-=scroll_begin.offsetwidth
Else
scroll_div.scrollleft++
}
var mymar=setinterval (Marquee,speed)
Scroll_div.onmouseover=function () {clearinterval (MyMar)}
Scroll_div.onmouseout=function () {Mymar=setinterval (marquee,speed)}
}
</script>
&LT;H2 align= "center" ><a href= "http://www.divcss5.com/" >DIVCSS5</a> Demo Note: Scroll left
<div style= "Text-align:center" >
<div class= "Sqborder" >
<!--#滚动区域 #####-->
<div id= "Scroll_div" class= "Scroll_div" >
<div id= "Scroll_begin" >
<ul>
<li><a href= "http://www.divcss5.com/" ></a></li >
<li><a href= "http://www.divcss5.com/" ></a></li >
<li><a href= "http://www.divcss5.com/" ></a ></li>
<li><a href= "http://www.divcss5.com/" ></a></li >
<li><a href= "http://www.divcss5.com/" ></a ></li>
<li><a href= "http://www.divcss5.com/" ></a></li >
<li><a href= "http://www.divcss5.com/" ></a></li >
<li><a href= "http://www.divcss5.com/" ></a></li >
<li><a href= "http://www.divcss5.com/" ></a></li >
<li><a href= "http://www.divcss5.com/" ></a></li >
<li><a href= "http://www.divcss5.com/" ></a></li >
<li><a href= "http://www.divcss5.com/" ></a> </li>
<li><a href= "http://www.divcss5.com/" ></a></li >
<li><a href= "http://www.divcss5.com/" ></a></li >
<li><a href= "http://www.divcss5.com/" ></a ></li>
<li><a href= "http://www.divcss5.com/" ></a></li >
</ul>
</div>
<div id= "Scroll_end" ></div>
</div>
<!--#滚动区域 #####-->
</div>
<script type= "Text/javascript" >scrollimgleft ();</script>
</div>
<!--//left-scroll code end-->
</body>

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.