看了几处代码,还是没大明白意思
<html> <head> <title> New Document </title> <script> var marqueeContent = new Array(); //滚动新闻 marqueeContent[0] = '<font color="#0000CC">14:25 </font><a href=http://www.xisuo.com/bbs/ target=_blank class="f12red">如果有回复则通过电子邮件提醒。只有注册用户才有此功能</a><br>'; marqueeContent[1] = '<font color="#0000CC">14:25 </font><a href=http://www.xisuo.com/bbs/ target=_blank class="f12red">如果您的帖子中有转帖代码请筛选复选此项</a><br>'; marqueeContent[2] = '<font color="#0000CC">14:25 </font><a href=http://www.xisuo.com/bbs/ target=_blank class="f12red">包含您在户口本中的签名只有注册用户有此功能</a><br>'; marqueeContent[3] = '<font color="#0000CC">14:25 </font><a href=http://www.xisuo.com/bbs/ target=_blank class="f12red">关于站点 | 广告服务 | 联系站长 | 版权隐私 | 项目合作 | 友情链接 | 投稿热线 | 网站地图</a><br>'; 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;height:' + marqueeHeight + 'px" onmouseover="clearInterval(marqueeInterval[0])" onmouseout="marqueeInterval[0]=setInterval(\'startMarquee()\',marqueeDelay)"><div>' + str + '</div></div>'); marqueeId++; marqueeInterval[0] = setInterval("startMarquee()", marqueeDelay); } function startMarquee() { var str = marqueeContent[marqueeId]; marqueeId++; if (marqueeId >= marqueeContent.length) marqueeId = 0; if (marqueeBox.childNodes.length == 1) { var nextLine = document.createElement('DIV'); nextLine.innerHTML = str; marqueeBox.appendChild(nextLine); } else { marqueeBox.childNodes[0].innerHTML = str; marqueeBox.appendChild(marqueeBox.childNodes[0]); marqueeBox.scrollTop = 0; } clearInterval(marqueeInterval[1]); marqueeInterval[1] = setInterval("scrollMarquee()", 20); } function scrollMarquee() { marqueeBox.scrollTop++; if (marqueeBox.scrollTop % marqueeHeight == (marqueeHeight - 1)) { clearInterval(marqueeInterval[1]); } } initMarquee(); </script> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> </head> <body> </body> </html>
只要就是根据javascript的定时函数,隔一定的时间将数组的值循环输出