这段代码如何实现鼠标移入时停止滚动,移出时继续滚动
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<style type="text/css">
*{margin: 0;padding:0;}
.bg{background: #345;border-radius: 20px;width: 350px;margin: 0 auto;font-family: "微软雅黑";color: #9cf;}
#box{height: 144px;overflow: hidden;}
#box ul{list-style: none;margin-left: 40px}
#box ul li{line-height: 25px;cursor: pointer;}
</style>
</head>
<body>
<div class="bg">
<div id="box">
<ul id='con1'>
<li>算一算虚度了多少个年头</li>
<li>仿佛足够写一套错爱的春秋</li>
<li>如果以后你还想为谁</li>
<li>浪费美好时候</li>
<li>眼泪只能在我的胸膛</li>
<li>毫无保留</li>
<li>互相折磨到白头</li>
<li>悲伤坚决不放手</li>
<li>开始纠缠之后</li>
<li>才又被人放大了自由</li>
<li>你的暴烈太温柔</li>
<li>感情又痛又享受</li>
</ul>
<ul id='con2'></ul>
</div>
</div>
<script type="text/javascript">
var box=document.getElementById('box'),
con1=document.getElementById('con1'),
con2=document.getElementById('con2'),
aLi=document.getElementsByTagName('li'),
h=25,//行高
timer,//计时器
timeo,
speed=30,//速度
delay=2000;//延时
con2.innerHTML=con1.innerHTML;
function startMove(){
box.scrollTop++
timer=setInterval(judge,speed)
}
function judge(){
if(box.scrollTop%h==0){
clearInterval(timer)
timeo=setTimeout(startMove,delay)
}
else{
box.scrollTop++
}
if(box.scrollTop>=con1.offsetHeight){
box.scrollTop=0
}
}
var timeo=setTimeout(startMove,delay)//初始化
var flag=0
for(var i=0;i<aLi.length;i++){
aLi[i].onmouseover=function(){
this.style.color="yellow";
//待补充
}
aLi[i].onmouseout=function(){
this.style.color="";
//待补充
}
}
</script>
</body>
</html>