为什么返回时,总是在1的地方要停顿一下 很奇怪啊,明明完全是按照算法的格式来的
不明白  有什么解决方法吗? (算法可以看cloudgamer大虾的Tween算法)
<body>
<div id='s' style=" height:20px; width:20px; background-color:#000000; left:20px; position:absolute"></div>
<br><br><br><br><br><br>
<div id='ss'></div>
<script>
var Tween = {
    Quart: {
            easeOut: function(t,b,c,d){
                return -c * ((t=t/d-1)*t*t*t - 1) + b;
            }
        }
}
///////////////////////////////////////////////////////////
function $(Id){return document.getElementById(Id)};
var t=0,b=parseInt($('s').style.left),c=100,d=100;
function Run(){
         $('s').style.left = Math.ceil(Tween.Quart.easeOut(t,b,c,d)) + "px";
 $('ss').innerHTML = $('s').style.left
         if(t<d)
 { t++; setTimeout(Run, 10); }
 else
 {
  t=0,b=parseInt($('s').style.left),c=c*(-1);
  setTimeout(Run, 2000)
 }
};
Run(); 
</script>
</body>