<div id="id">
#d1
#d2
</div >
function toutiaoScroll(){
var speed=90
var news=document.getElementById("id");
var news1=document.getElementById("d1");
var news2=document.getElementById("d2");
news2.innerHTML=news1.innerHTML
function Marquee(){
if(news.scrollTop>=news1.offsetHeight){
news.scrollTop=0;
}
else{
news.scrollTop=news.scrollTop+1;
}
}
var MyMar=setInterval(Marquee,speed)
news.onmouseover=function(){clearInterval(MyMar)}
news.onmouseout=function(){MyMar=setInterval(Marquee,speed)}
}
toutiaoScroll();
网友评论