<div class="codetitle"> <span><a style="CURSOR: pointer" data="30651" class="copybut" id="copybut30651" onclick="doCopy('code30651')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code30651"> <br><br><br><br> <title>走马灯</title> <br> <script type="text/javascript"><br><br> var direction ='left';<BR> var intervalId = window.setInterval(function () {<BR> if (direction == 'right') {<BR> var title = document.title;<BR> var firstchar = title.charAt(0);<BR> var lastchar = title.substring(1, title.length);<BR> document.title = lastchar + firstchar;<BR> }<BR> if (direction == 'left') {<BR> var title = document.title;<BR> var firstchar = title.charAt(title.length - 1);<BR> var lastchar = title.substring(0, title.length - 1);<BR> document.title = firstchar + lastchar;<BR> }<BR> }, 2000)<BR> </script><br><br><br><br><br> </div>