Js image drive lights and js drive lights

Source: Internet
Author: User

Js image drive lights and js drive lights

<style type="text/css">#demo {background: #FFF;overflow:hidden;border: 1px dashed #CCC;width: 90%;}#demo img {border: 3px solid #F2F2F2;}#indemo {float: left;width: 800%;}#demo1 {float: left;}#demo2 {float: left;}</style><center><div id="demo"><div id="indemo"><div id="demo1"><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a></div><div id="demo2"><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a><a></a></div></div></div><script><!--var speed=10;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.offsetWidthelse{tab.scrollLeft++;}}var MyMar=setInterval(Marquee,speed);tab.onmouseover=function() {clearInterval(MyMar)};tab.onmouseout=function() {MyMar=setInterval(Marquee,speed)};--></script></center>






Js image marquee code

See the <marquee> </marquee> label ....
HTML tag...

Js drive lamp Effect

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "www.w3.org/..al.dtd">
<Html xmlns = "www.w3.org/5o/xhtml">
<Head>
<Title> javascript seamless scrolling </title>
<Meta charset = "gb2312"/>
<Style type = "text/css">
# Marquee, # marquee li {padding: 0px; margin: 0px ;}
# Marquee {position: relative; list-style: none; height: 150px; width: 210px; padding-left: 5px; overflow: hidden; border: 10px solid # eee ;}
# Marquee li {position: absolute; font-size: 12px ;}
# Marquee a {display: block; color: #999999; text-decoration: none ;}
</Style>
<Script type = "text/javascript">
Var Marquee = function (id ){
Tryequaldocument.exe cCommand ("BackgroundImageCache", false, true);} catch (e ){};
Var container = document. getElementById (id ),
Slide = container. getElementsByTagName ("li") [0],
Speed = arguments [1] | 80, // speed
Delta = 0, // The current scroll position
Critical = slide. offsetHeight; // critical point
Slide. innerHTML + = slide. innerHTML;
Var rolling = function (){
Delta =-critical? Delta = 0: delta --;
Slide. style. top = delta + "px ";
}
Var timer = setInterval (rolling, sp ...... remaining full text>

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.