复制代代码如下: < title>热点新闻滚動<br><!--<BR>body {<BR> margin: 0px;<BR> font-サイズ: 12px;<BR> カラー: #938C43;<BR> 行の高さ: 150%;<BR> text-align:center;<BR>}<BR>a:link{color: #9D943A;font-size :12px;}<BR>a:hover{color: #FF3300;font-size:12px;}<BR>a:visited{color: #9D943A;font-size:12px;}<BR>a.red:link {color: #ff0000;font-size:12px;}<BR>a.red:hover{color: #ff0000;font-size:12px;}<BR>a.red:visited{color: #ff0000;font-サイズ:12px;}<BR>#marqueeBox{background:#f7f7f7;border:1px ソリッドシルバー;padding:1px;text-align:center;margin:0 auto;}<BR>--><br>< /style><br></head> <p><body><br><h4>滚アニメーション新闻</h4><br><script language="JavaScript" type="text/javascript"><br>var marqueeContent=new Array( );<br>marqueeContent[0]="<a href='http://www.jb51.net' target='_blank'>脚本之家</a>";<br>marqueeContent[1 ]="<a href='http://play.jb51.net' target='_blank'>播放器之家</a>";<br>marqueeContent[2]="<a href ='http://sc.jb51.net' target='_blank'>素材之家</a>";<br>marqueeContent[3]="<a href='http://mingzi. jb51.net' target='_blank'>个性名字网</a>";<br>var marqueeInterval=new Array();<br>var marqueeId=0;<br>var marqueeDelay=2000;<br>var marqueeHeight=20;<br>function initMarquee() {<br> var str=marqueeContent[0];<br> document.write('<div id="marqueeBox" style="overflow:hidden;width: 250px;height:' marqueeHeight 'px" onmouseover="clearInterval(marqueeInterval[0])" onmouseout="marqueeInterval[0]=setInterval('startMarquee()',marqueeDelay)"><div>' /div></div>');<br> marqueeId ;<br> marqueeInterval[0]=setInterval("startMarquee()",marqueeDelay);<br>}<br>function startMarquee() {<br> var str=marqueeContent[marqueeId];<br> marqueeId ;<br> if(marqueeId>=marqueeContent.length) marqueeId=0;<br> if(document.getElementById("marqueeBox").childNodes.length==1) {<br> var nextLine=document.createElement('DIV');<br> nextLine.innerHTML=str;<br> document.getElementById("marqueeBox").appendChild(nextLine);<br> }<br> else {<br> document.getElementById("marqueeBox").childNodes[0].innerHTML=str;<br> document.getElementById("marqueeBox").appendChild(document.getElementById("marqueeBox").childNodes[0]) ;<br> document.getElementById("marqueeBox").scrollTop=0;<br> }<br> clearInterval(marqueeInterval[1]);<br> marqueeInterval[1]=setInterval("scrollMarquee()",20) ;<br>}<br>関数scrollMarquee() {<br> document.getElementById("marqueeBox").scrollTop ;<br> if(document.getElementById("marqueeBox").scrollTop%marqueeHeight==(marqueeHeight-1 )){<br> clearInterval(marqueeInterval[1]);<br> }<br>}<br>initMarquee();<br></script><br></body><br>< /html></td><br> </tr><br> </table> <br></p> </div>