HTML代码:
![](/Images/OutliningIndicators/ContractedBlock.gif)
Code
var speed=50
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetTop-demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight
else{
demo.scrollTop++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
demo2如果没有设置高度,循环完一遍后就会跳动一下,给人感觉不是很流畅,如果加了高度就没有这个问题