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.111cn.net/1999/xhtml "> <pead> <title>js+css discontinuous and uninterrupted text scrolling code </title > <meta http-equiv= "content-type" content= "text/html;charset=gb2312" > <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> <div class= "box" id= "marqueebox0" > <ul> <li > First line </li& Gt <li > second line </li> <li > Third line </li> </ul> </div><br> <div class= "box" id= "Marqu" Eebox1 "> <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>=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