<script type="text/javascript">
var area = document.getElementById('moocBox');
var con1 = document.getElementById('con1');
var con2 = document.getElementById('con2');
var speed = 50;
var iHeight=24;
var delay=2000;
var time;
area.scrollTop = 0;
con2.innerHTML = con1.innerHTML; //克隆con1给con2
setTimeout('star()',delay);//初始化
function star(){
area.scrollTop++;
time=setInterval('starscroll()',speed);
}
function starscroll(){
if(area.scrollTop % iHeight==0){
clearInterval(time);
setTimeout('star()',delay)
}else{
area.scrollTop++;
if(area.scrollTop >= con1.scrollHeight){
area.scrollTop=0;
}
}
}
area.onmouseenter=function(){
clearInterval(time);
}
area.onmouseleave=function(){
time=setInterval('starscroll()',speed);
}
</script>