clearInterval(obj.timer); obj.timer=setInterval(function(){ var who=0; who=parseInt(getStyle(obj,attr)); alert(who); var speed=(target-who)/5; //已经取整了 怎么还是出现396px 而不是400px speed=speed>0?Math.ceil(speed):Math.floor(speed); if(speed==target) { clearInterval(obj.timer); } obj.style[attr]=who+speed+"px"; },30);
添加回答
举报
0/150
提交
取消