复主代码 代码如下: < title>热点new闻滚动<br><!--<BR>body {<BR> 여백: 0px;<BR> font- 크기: 12px;<BR> 색상: #938C43;<BR> 줄 높이: 150%;<BR> text-align:center;<BR>}<BR>a:link{color: #9D943A;글꼴 크기 :12px;}<BR>a:hover{color: #FF3300;font-size:12px;}<BR>a:visited{color: #9D943A;font-size:12px;}<BR>a.red:link {색상: #ff0000;글꼴 크기:12px;}<BR>a.red:hover{색상: #ff0000;글꼴 크기:12px;}<BR>a.red:visited{색상: #ff0000;글꼴- size:12px;}<BR>#marqueeBox{배경:#f7f7f7;border:1px solid silver;padding:1px;text-align:center;margin:0 auto;}<BR>--><br>< /style><br></head> <p><body><br><h4>滚动new闻</h4><br><script 언어="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>' str '< /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>function 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>