代码有错的
<style type="text/css">
*{
margin:0;
padding:0;
}
ul li{
list-style:none;
}
li{
width:200px;
height:200px;
background:red;
margin-bottom:10px;
}
</style>
<script type="text/JavaScript">
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[i].onmouseover=function(){
startMove(this,200);
}
}
function startMove(obj,oTargin){
clearInterval(obj.timer);
obj.setInterval(function(){
var speed=0;
if(obj.offsetWidth>oTargin){
speed=-10;
}
else{
speed=10;
}
if(obj.offsetWidth==oTargin){
clearInterval(obj.timer);
}
else{
obj.style.width=obj.offsetWidth+speed+'px';
}
},30)
}
</script>
帮忙看一下哪里出错了