JavaScript discontinuous Seamless text scrolling effect

Source: Internet
Author: User
Tip: You can modify some of the code before running

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <ptml xmlns=" http://www.w3.org/1999/xhtml "> <pead> <title> discontinuous and seamless scrolling effect of two text </title> < Meta http-equiv= "Content-type" content= "text/html;charset=gb2312" > <!--Add the following code to <pead> and </pead> Between--> <style type= "Text/css" > Box{width:150px;height:25px;line-height:25px;border: #bbb 1px solid;overflow : Hidden;} . Box ul{margin:0;padding:0}. Box Li{height:25px;line-height:25px;font-size:12px;text-align:center;list-style-type : none; </style> </pead> <body> <!--Add the following code between <body> and </body>--> <div class= "box id=" Marqueebox0 "> <ul> <li > First line </li> <li > second line </li> <li > Third Line ;/li> </ul> </div><br/> <div class= "box" id= "Marqueebox1" > <ul> <li > First Line </li> <li > second line </li> <li > Third line </li> </ul> </div> <script type= "Text/javascript" > Function StartMarquee (Lh,speed,delay,index) {var T; var P=false; var O=document.getelementbyid ("Marqueebox" +index); o.innerhtml+=o.innerhtml; O.onmouseover=function () {p=true} o.onmouseout=function () {p=false} o.scrolltop = 0; function Start () {t=setinterval (scrolling,speed); if (!p) {o.scrolltop + = 1;} The function scrolling () {if (o.scrolltop%lh!=0) {o.scrolltop = 1; if (O.SCROLLTOP&GT;=O.SCROLLHEIGHT/2) o.scrolltop = 0; }else{clearinterval (t); SetTimeout (Start,delay); } settimeout (Start,delay); } startmarquee (25,30,3000,0); StartMarquee (25,40,0,1); </script> </body> </ptml>
Tip: You can modify some of the code before running
Related Article

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.