<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> untitled document </title>
<Style type = "text/css">
<!
-- # Demo
{
Overflow: hidden;
Width: 220px;
Float: left;
Display: inline;
}
# Demo ul
{
Text-align: left;
Margin: 0px;
Padding: 0px;
Width: 220px;
}
# Demo ul li
{
Margin-left: 5px;
Display: block;
List-style: none;
Font-size: 13px;
Height: 26px;
Padding-top: 5px;
}
--> </Style>
</Head>
<Body>
// The height here is style = "height: 26px. If you are not sure about this, you need to customize the input. Otherwise, if the definition is high and the li in ul does not reach this height, scrolling will fail.
<Div id = "demo" style = "height: 26px;">
<Div id = "demo1">
<Ul>
<Li> · <a href = "http://www.bkjia.com/"> era front-end 1 </a> </li>
<Li> · <a href = "http://www.bkjia.com"> era front-end 2 </a> </li>
<Li> · <a href = "http://www.bkjia.com //"> front end 3 </a> </li>
<Li> · <a href = "http://www.bkjia.com //"> front-end 4 </a> </li>
</Ul>
</Div>
<Div id = "demo2">
</Div>
<Script type = "text/javascript">
// Uninterrupted text scrolling code, compatible with IE, Firefox, and Opera
Var speed = 60;
Var FGDemo = document. getElementById ('Demo ');
Var FGDemo1 = document. getElementById ('demo1 ');
Var FGDemo2 = document. getElementById ('demo2 ');
FGDemo2.innerHTML = FGDemo1.innerHTML
Function Marquee1 (){
If (FGDemo2.offsetHeight-FGDemo. scrollTop <= 0)
FGDemo. scrollTop-= FGDemo1.offsetHeight
Else {
FGDemo. scrollTop ++
}
}
Var MyMar1 = setInterval (Marquee1, speed)
FGDemo. onmouseover = function () {clearInterval (MyMar1 )}
FGDemo. onmouseout = function () {MyMar1 = setInterval (Marquee1, speed )}
</Script>
</Div>
</Body>
</Html>
From colyn