这代码有啥问题吗,为啥23行老是报错呢
function arr(obj,json,fn){
var flag=true //
clearInterval(obj.timer);
obj.timer=setInterval(function(){
for(var attr in json){
var icun=0;
//判断是opacity就parseflaot(取浮点数),parseInt
if(attr=='opacity'){
icun=Math.round(parseFloat(getstyle(obj,attr))*100)
}else{
icun=parseInt(getstyle(obj,attr));
}
//设置速度
var speed=(json[attr]-icun)/20;
speed=speed>0?Math.ceil(speed):Math.floor(speed);
if(json[attr]!=icun){
flag=false
}
if('opacity'){
li.style[attr]=(icun+speed)/100;
}
li.style[attr]=icun+speed+'px';
if(flag){
clearInterval(obj.timer);
if(fn){
fn();
}
}
}
},20);
}