<script> <BR>var speed=20;/*速度数值越大速度越慢*/ <BR>document.getElementById('www_qpsh_com2').innerHTML=document.getElementById('www_qpsh_com1').innerHTML; <br><br>/*两个层来回交替出现*/ <BR>function Marquee(){ <BR>if(document.getElementById('www_qpsh_com2').offsetWidth-document.getElementById('www_qpsh_com').scrollLeft<=0) <BR>document.getElementById('www_qpsh_com').scrollLeft-=document.getElementById('www_qpsh_com1').offsetWidth; <BR>else{ <BR>document.getElementById('www_qpsh_com').scrollLeft++; <BR>} <BR>document.getElementById('my_marquee_info').innerHTML=''; <BR>document.getElementById('my_marquee_info').innerHTML+='div.scrollTop:'+document.getElementById('www_qpsh_com').scrollLeft; <BR>} <BR>var MyMar=setInterval(Marquee,speed); <BR>www_qpsh_com.onmouseover=function() {clearInterval(MyMar);} <BR>www_qpsh_com.onmouseout=function() {MyMar=setInterval(Marquee,speed);} <BR></script>
演示代码: