实在找不出为什么我的就是没有反应呢?
<script type="text/javascript">
window.onload=function(){
var odiv=document.getElementsByTagName("div");
for(var i=0;i<odiv.length;i++){
odiv[i].alpha=30;
odiv[i].onmoseover=function(){
statemove(this,100);
}
odiv[i].onmoseout=function(){
statemove(this,30);
}
}
}
function statemove(obj,long){
clearInterval(obj.timer);
obj.timer=setInterval(function(){
var speed=0;
if(obj.alpha>long){
speed=-10;
} else{
speed=10;
}
if(obj.alpha==long) {
clearInterval(obj.timer);
}else{
obj.alpha+=speed;
obj.style.filter="alpha(opacity:'+obj.alpha+')";
obj.style.opacity=obj.alpha/100;
}
},30)
}