求大神 怎么运行不变色
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>透明</title>
<style type="text/css">
*{
margin: 0px;
padding: 0px;
}
.div1{
width: 200px;
height: 200px;
background: red;
filter: alpha(opacity:30);
opacity: 0.3;
margin: 10px;
float: left;
}
</style>
<script type="text/javascript">
window.onload=function(){
var oDiv=document.getElementsByClassName('div');
for(var i =0; i<oDiv.length;i++){
oDiv[i].alpha=30;
oDiv[i].onmouseover=function(){
startmove(this,100);
}
oDiv[i].onmouseout=function(){
startmove(this,30);
}
}}
// var timer=null,
// speed=0,
// alpha=30;
function startmove(obj,iTarget){
var speed=0;
clearInterval(obj.timer);
obj.timer=setInterval(function(){
if(obj.alpha>iTarget){
speed=-10;
}else{
speed=10;
}
if(obj.alpha==iTarget){
clearInterval(obj.timer);
}
else{
obj.alpha+=speed;
obj.style.filter='alpha(opactiy:"+obj.alpha+")';
obj.style.opacity=obj.alpha/100;}
},30)
}
</script>
</head>
<body>
<div class="div1"></div>
<div class="div1"></div>
<div class="div1"></div>
<div class="div1"></div>
<div class="div1"></div>
</body>
</html>