请帮忙看看 为什么物体运动停不下来
<!DOCTYPE HTML> <html > <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>js运动</title> <style> *{margin:0px;padding:0px;} #div1{ height:200px; width:200px; background-color:red; position:relative; left:-200px; } #share{ height:50px; background-color:blue; position:absolute; top:100px; left:200px; color:#FFFFFF; } </style> <script> var timer=null; window.onload=function(){ var oDiv=document.getElementById('div1'); oDiv.onmouseover=startMove; } function startMove(){ clearInterval(timer); var oDiv=document.getElemenstById('div1'); timer=setInterval(function(){ if ((oDiv.style.left = oDiv.offsetLeft)) { clearInterval(timer); } else { oDiv.style.left = oDiv.offsetLeft + 1 + 'px'; } },30); } </script> </head> <body> <div id="div1"> <span id="share">分享</span> </div> </body> </html>
请帮忙看为什么停不下来???