动画效果没有显示出来,求指错
<style type="text/css">
*{margin:0;padding:0;}
ul,li{
list-style:none;
}
ul li{
width:200px;
height:100px;
background:yellow;
margin-bottom:20px;
}</style>
<script>
window.onload=function(){
var odiv=document.getElementsByTagName('li');
for(var i=0;i<odiv.length;i++){
odiv[i].timer=null;
odiv[i].onmouseover=function(){
startMove(this,400);}
odiv.onmouseout[i]=function(){
startMove(this,200);}
}
}
function startMove(obj,iTarget){
clearInterval(obj.timer);
obj.timer=setInterval(function(){
var speed=(iTarget-obj.offsetWidth)/8;
speed=speed>0?Math.ceil(speed):Math.floor(speed);
if(alpha==iTarget){
clearInterval(obj.timer);}
else{
obj.style.width=obj.offsetWidth+speed+'px';
}
}
,30)
}
</script>
</head>
<body>
<ul>
<li></li>
<li></li>
<li></li></ul></body>
</html>