var area=document.getElementById("moocBox");
area.innerHTML+=area.innerHTML;
scroll_byline(area,50,24,2000);
function scroll(element,speed,lineH){
element.timer=setInterval(function(){
if(element.scrollTop>=element.scrollHeight/2){
element.scrollTop=0;//只在这里进行了初始化
}
element.scrollTop++;
//提前终止
if(element.scrollTop%lineH==0){
clearInterval(element.timer);
}
},speed)
}
function scroll_byline(element,speed,lineH,delay){
setInterval(function(){
clearInterval(element.timer);
scroll(element,speed,lineH);
},delay)
}