大神们好,如果我想在这行代码中加入悬停效果,该如何加?
<script type="text/javascript">
var area=document.getElementById("moocBox");
area.innerHTML+=area.innerHTML;
var liHeight=24;
area. scrollTop=0;
function startMove(){
area.scrollTop++;
time=setInterval("scrollUp()",50)
}
function scrollUp(){
if (area.scrollTop%liHeight==0){
clearInterval(time);
setTimeout("startMove()",2000);
}else{
area.scrollTop++;
if(area.scrollTop>=area.scrollHeight/2){
area.scrollTop=0;
}
}
}
setTimeout("startMove()",2000);
area.onmouseover=function(){
clearInterval(time);
}
area.onmouseout=startMove;