- js原生完美运动框架`
//获取非行内样式
function getStyle(obj,attr){
return obj.currentStyle?obj.currentStyle[attr]:getComputedStyle(obj,true)[attr];
}
//完美运动框架
fucntion sport(obj,attr,fn){
clearInterval(obj.timer);
for(let ]attr in json){
let flag=true;
let cur=attr==='opacity'?Math.floor(parseFloat(getStyle(obj,attr))*100):parseInt(getStyle(obj,attr));
let speed=(json[attr]-cur)/8;
speed=speed>0?Math.ceil(speed):Math.floor(speed);
if(cur!==json[attr]){
flag=false;
}
if(attr in json){
}
}
}