Copy codeThe Code is as follows:
<! 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> hot news rolling </title>
<Style type = "text/css">
<! --
Body {
Margin: 0px;
Font-size: 12px;
Color: #938C43;
Line-height: 150%;
Text-align: center;
}
A: link {color: # 9D943A; font-size: 12px ;}
A: hover {color: # FF3300; font-size: 12px ;}
A: visited {color: # 9D943A; font-size: 12px ;}
A. red: link {color: # ff0000; font-size: 12px ;}
A. red: hover {color: # ff0000; font-size: 12px ;}
A. red: visited {color: # ff0000; font-size: 12px ;}
# MarqueeBox {background: # f7f7f7; border: 1px solid silver; padding: 1px; text-align: center; margin: 0 auto ;}
-->
</Style>
</Head>
<Body>
<H4> rolling news <Script language = "JavaScript" type = "text/javascript">
Var marqueeContent = new Array ();
MarqueeContent [0] = "<a href = 'HTTP: // www.jb51.net 'target =' _ blank '> script home </a> ";
MarqueeContent [1] = "<a href = 'HTTP: // play.jb51.net 'target =' _ blank '> player home </a> ";
MarqueeContent [2] = "<a href = 'HTTP: // SC .jb51.net 'target =' _ blank '> Home of materials </a> ";
MarqueeContent [3] = "<a href = 'HTTP: // mingzi.jb51.net 'target =' _ blank '> personalized Name Network </a> ";
Var marqueeInterval = new Array ();
Var marqueeId = 0;
Var marqueeDelay = 2000;
Var marqueeHeight = 20;
Function initMarquee (){
Var str = marqueeContent [0];
Document. write ('<div id = "marqueeBox" style = "overflow: hidden; width: 250px; height:' + marqueeHeight + 'px" onmouseover = "clearInterval (marqueeInterval [0]) "onmouseout =" marqueeInterval [0] = setInterval ('startmarquee () ', marqueeDelay) "> <div>' + str + '</div> ');
MarqueeId ++;
MarqueeInterval [0] = setInterval ("startMarquee ()", marqueeDelay );
}
Function startMarquee (){
Var str = marqueeContent [marqueeId];
MarqueeId ++;
If (marqueeId> = marqueeContent. length) marqueeId = 0;
If (document. getElementById ("marqueeBox"). childNodes. length = 1 ){
Var nextLine = document. createElement ('div ');
NextLine. innerHTML = str;
Document. getElementById ("marqueeBox"). appendChild (nextLine );
}
Else {
Document. getElementById ("marqueeBox"). childNodes [0]. innerHTML = str;
Document. getElementById ("marqueeBox"). appendChild (document. getElementById ("marqueeBox"). childNodes [0]);
Document. getElementById ("marqueeBox"). scrollTop = 0;
}
ClearInterval (marqueeInterval [1]);
MarqueeInterval [1] = setInterval ("scrollMarquee ()", 20 );
}
Function scrollMarquee (){
Document. getElementById ("marqueeBox"). scrollTop ++;
If (document. getElementById ("marqueeBox"). scrollTop % marqueeHeight = (marqueeHeight-1 )){
ClearInterval (marqueeInterval [1]);
}
}
InitMarquee ();
</Script>
</Body>
</Html> </td>
</Tr>
</Table>