透明度动画(类淘宝划过图片效果),鼠标划过、划出图片透明度不改变
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>透明度动画应用</title>
<style>
*{margin: 0;padding: 0;}
ul{list-style: none;}
img{border: 0;}
#imgbox{width:664px;margin: 50px auto;}
#imgbox ul li{overflow: hidden;border: 1px solid #B7B5B5;}
#imgbox ul li:first-child{margin-bottom: -1px;}
#imgbox ul li a{float: left;text-decoration: none;padding: 10px;}
.ablr{border-width: 0px 1px 0px 1px;border-style: solid;border-color: #B7B5B5;}
</style>
</head>
<body>
<div id="imgbox">
<ul>
<li>
<a href="#"><img src="1.jpg"></a>
<a href="#"><img src="2.jpg"></a>
<a href="#"><img src="3.jpg"></a>
</li>
<li>
<a href="#"><img src="4.jpg"></a>
<a href="#"><img src="5.jpg"></a>
<a href="#"><img src="6.jpg"></a>
</li>
</ul>
</div>
<script src="jsopacity.js"></script>
</body>
</html>
jsopacity.js
window.onload=function(){
var box=document.getElementById('imgbox'),
img=box.getElementsByTagName('img');
for(var i=0;i<img.length;i++){
img[i].onmouseover=function(){
startchange(50,this)
};
img[i].onmouseout=function(){
startchange(100,this)
};
}
会出现有多个图片同时处在选中状态,请问哪里错了、、