<strong>1.先写两个最常用最简洁的滚动代码</strong> <br>代码如下: <br>水平滚动: <br><marquee direction="left" align="bottom" height="25" width="100%" onmouseout="this.start()" onmouseover="this.stop()" scrollamount="2" scrolldelay="1">水平滚动字幕内容</marquee> <br>垂直滚动: <br><marquee direction="up" height="200" onmouseout="this.start()" onmouseover="this.stop()" scrollamount="1" scrolldelay="1">垂直滚动字内容</marquee> <br><strong>2.平稳不间断滚动 <br></strong><div class="codetitle"> <span><a style="CURSOR: pointer" data="84698" class="copybut" id="copybut84698" onclick="doCopy('code84698')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code84698"> <br><script language="JavaScript"> <BR>var tm=null <BR>function newsScroll() { <BR>var scrollimg=document.getElementById("scroll") <BR>if(scrollimg.parentNode.scrollTop!=(scrollimg.clientHeight/2)) <BR>scrollimg.parentNode.scrollTop++; <BR>else <BR>scrollimg.parentNode.scrollTop=0 <BR>} <BR>window.onload=function() { <BR>tm=setInterval('newsScroll()',25) <BR>} <BR>function stop() <BR>{ <BR>clearInterval(tm) <BR>} <BR>function start() <BR>{ <BR>tm=setInterval('newsScroll()',25) <BR>} <BR></script> <br>/* stop() start() 不能和调用ID在同一个容器内, 如容器没默认高度 要制定高度*/ <br> </div> <br><strong>3 有停留滚动 <br></strong>代码示例: <br><div class="htmlarea"><textarea id="runcode79252"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title></title></textarea></div>