为什么我的向左滚动没有效果呢 T_T
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Dodument</title>
<style>
*{margin: 0; padding: 0; font-size: 12px;}
#box{width: 140px; height: 25px; margin: 50px auto; overflow: hidden;}
#scroller{width: 200%; height: 25px; margin: 0 auto auto 10px; line-height: 25px; white-space: nowrap; }
#scroller div{float: left; margin-left: 10px;}
</style>
</head>
<body>
<div id="box">
<div id="scroller">
<div id="con1">js实现文字向左滚动</div>
<div id="con2"></div>
</div>
</div>
<script>
var area=document.getElementById('scroller'),
con1=document.getElementById('con1'),
con2=document.getElementById('con2');
con2.innerHTML=con1.innerHTML;
function scrollleft() {
if (area.scrollLeft-con2.offsetWidth>=0) {
area.scrollLeft-=con1.offsetWidth;
} else {
area.scrollLeft++;
}
}
var speed=50;
var myScroll=setInterval('scrollleft()',speed);
area.onmousemove=function () {
clearInterval(myScroll);
}
area.onmouseout=function () {
myScroll=setInterval('scrollleft()',speed);
}
</script>
</body>
</html>