鼠标移入移出 为什么鼠标在box里面移动的时间文字会滚动?
<script type="text/javascript">
window.onload=function(){
var timer1=null;
timer1=setTimeout('startMove()',2000);
};
var area=document.getElementById('box');
//var con1=document.getElementById('con1');
//var con2=document.getElementById('con2');
var iLiHeight=24;
var timer=null;
area.scrollTop=0;
area.innerHTML+=area.innerHTML;
var speed=50;
var delay=2000;
function startMove(){
area.scrollTop++;
timer=setInterval('scrollUp()',speed);
}
function scrollUp(){
if(area.scrollTop%iLiHeight==0){
clearInterval(timer);
timer1=setTimeout('startMove()',delay);
}else{
area.scrollTop++;
if(area.scrollTop>=area.scrollHeight/2)
{
area.scrollTop=0;
}
}
}
area.onmouseover=function(){
clearInterval(timer);
clearInterval(timer1);
}
area.onmouseout=function(){
clearInterval(timer);
clearInterval(timer1);
startMove();
}
</script>