请大神帮我看一下哪里错了,鼠标经过没有反应
<html>
<head>
<title>透明度变换</title>
<meta charset="utf-8">
<style type="text/css">
*{
margin: 0px;
padding: 0px;
}
div{
width: 300px;
height: 200px;
background: red;
/*filter: alpha(opacity:30);*/
opacity: 0.3;
float: left;
margin-right: 20px;
}
</style>
<script type="text/javascript">
window.onload=function() {
var oDiv=document.getElementsByTagName('div');
for(var i=0;i<oDiv.length;i++){
//oDiv[i].opacity=0.3;
oDiv[i].onmouseover=function(){
startOver(this,0.9);
}
oDiv[i].onmouseout=function(){
startOver(this,0.3);
}
}
}
function startOver(obj,iTarget){
var obj.timer=null;
obj.timer=setInterval(function(){
var speed=(iTarget-obj.style.opacity)/8;
speed=speed>0?Math.ceil(speed):Math.floor(speed);
if (obj.style.opacity==iTarget) {
clearInterval(obj.timer);
}else{
obj.style.opacity=obj.style.opacity+speed;
}
},30);
}
</script>
</head>
<body>
<div ></div>
<div ></div>
<div ></div>
<div ></div>
</body>
</html>