div Picture Marquee Seamless Connection implementation code

Source: Internet
Author: User
Tags setinterval
The code is as follows:


<html>


<head>


<style type= "Text/css" >


<!--


#demo {


Background:none Repeat scroll 0 0 #FFFFFF;


border:1px solid #98CBFF;


margin-bottom:10px;


margin-left:5px;


Overflow:hidden;


padding:0 0 5px;


width:948px;


}


#demo img {


border:3px solid #F2F2F2;


}


#indemo {


Float:left;


width:800%;


}


#demo1 {


Float:left;


}


#demo2 {


Float:left;


}


. Box {


border:1px solid #98CBFF;


Float:left;


margin:7px 10px;


Overflow:hidden;


padding:5px;


width:150px;


}


-->


</style>


</head>


<body>


Picture scrolling left Seamless
Scroll left

The

code is as follows:


<div id= "Demo" >


<div id= "Indemo" >


<div id= "Demo1" >


<div class= "box" >


<a href= "#" ><img src= "clear_logo.gif" border= "0"/></a>


<p> Your number </p>


Hello


</div>


<div class= "box" >


<a href= "#" ><img src= "clear_logo.gif" border= "0"/></a>


<p> Idiots </p>


Stupid


</div>


<div class= "box" >


<a href= "#" ><img src= "clear_logo.gif" border= "0"/></a>


</div>


</div>


<div id= "Demo2" ></div>


</div>


</div>


<script>


<!--


var speed=10; The larger the number, the slower the


var Tab=document.getelementbyid ("demo");


var Tab1=document.getelementbyid ("Demo1");


var Tab2=document.getelementbyid ("Demo2");


tab2.innerhtml=tab1.innerhtml;


function Marquee () {


if (tab2.offsetwidth-tab.scrollleft<=0)


Tab.scrollleft-=tab1.offsetwidth


else{


tab.scrollleft++;


}


}


var mymar=setinterval (marquee,speed);


tab.onmouseover=function () {clearinterval (MyMar)};


tab.onmouseout=function () {Mymar=setinterval (marquee,speed)};


-->


</script>


</body>


</html>

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.