为什么我这个在火狐里面不行呢
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<style>
*{margin:0; padding:0;}
ul,li{list-style:none;}
ul li{
width:200px; height:100px; background:yellow; margin-bottom:20px; border:4px solid #333; filter:alpha(opacity:30);opacity:0.3;
}
</style>
<script>
window.onload=function(){
var aLi=document.getElementsByTagName('li');
for(var i=0;i<aLi.length;i++){
aLi[i].timer=null;
aLi[i].onmousemove=function(){
startMove(this,400)
}
aLi[i].onmouseout=function(){
startMove(this,200);
}
}
}
function getStyle(obj,attr){
if(obj.currentStyle){
return obj.currentStyle[attr];
}else{
return getComputedStyle(obj,false)[attr];
}
}
function startMove(obj,iTarget){
clearInterval(obj.timer);
obj.timer=setInterval(function(){
var icur=parseInt(getStyle(obj,'width'))
var speed=(iTarget-icur)/8;
speed=speed>0?Math.ceil(speed):Math.floor(speed);
if(icur==iTarget){
clearInterval(obj.timer)
}else{
obj.style['width']=icur+speed+'px'
}
})
}
</script>
<body>
<ul>
<li></li>
<li></li>
<li></li>
</ul>
</body>
</html>