问一下哪里错了
<!DOCTYPE html>
<html>
<head>
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script>
<meta charset="UTF-8">
<title>JS缓冲动画</title>
<style type="text/css">
body,ul,ol,li,p,h1,h2,h3,h4,h5,h6,form,fieldset,table,td,img,div,dl,dt,
dd,input{margin:0;padding:0;}
body{font-size:12px;}
img{border:none;}
li{list-style:none;}
input,select,textarea{outline:none;}
textarea{resize:none;}
#div1{
height: 200px;
width: 200px;
background-color: red;
position: relative;
left: -200px;
top: 0;
}
#div1 span{
background-color: blue;
width:20px;
height: 50px;
position: absolute;
left: 200px;
top: 75px;
}
</style>
<script type="text/javascript">
window.onload=function(){
var oDiv=document.getElementById('div1');
oDiv.onmouseover=function(){
startMove(0);
}
oDiv.onmouseout=function(){
startMove(-200);
}
}
var timer=null;
function startMove(iTarget) {
clearInterval(timer);
var oDiv=document.getElementById('div1');
var speed=(iTarget-oDiv.offsetLeft)/30;
speed = speed>0?Math.ceil(speed):Math.floor(speed);
timer=setInterval(function(){
if(oDiv.offsetLeft==iTarget){
clearInterval(timer);
}
else{
oDiv.style.left=oDiv.offsetLeft+speed+'px';
}
},30)
}
</script>
</head>
<body>
<script type="text/javascript">
</script>
<div id="div1" ><span id="share">分享</span></div>
</body>
</html>