aaaaaaaaaaa
aaaaaaaaaaa
aaaaaaaaaaa
aaaaaaaaaaa
aaaaaaaaaaa
aaaaaaaaaaa
|
|
<script> <BR>var speed=15 <BR>demo2.innerHTML=demo1.innerHTML//克隆demo1为demo2 <BR>function Marquee(){ <BR>if(demo2.offsetHeight-demo.scrollTop<=0)//当滚动至demo1与demo2交界时 <BR>demo.scrollTop-=demo1.offsetHeight//demo跳到最顶端 <BR>else{ <BR>demo.scrollTop++ //如果是横向的 将 所有的 height top 改成 width left <BR>} <BR>} <BR>var MyMar=setInterval(Marquee,speed)//设置定时器 <BR>demo.onmouseover=function() {clearInterval(MyMar)}//鼠标移上时清除定时器达到滚动停止的目的 <BR>demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}//鼠标移开时重设定时器 <BR></script>