我得到了一个垂直的评价带,我有一个方法可以使它
top
每隔几秒钟计算一次值(取决于当前证明的高度)。
现在,当用户悬停在它上面时,它会立即停止(通过
.stop()
间隔也通过
clearInterval(idOfinterval)
但我仍然想知道在它突然停止之前它还剩下多少像素需要动画。
所以我查了一下
documentation
我看到有一个
step
方法,该方法具有回调并可以为我提供有关每个(?)的信息动画的步骤。
参见部分代码
//in middle of a object literal
animate:function(){
animAmmount = someCalculation;
testimonialsBelt.parentElment.animate({
top:"-="+howMuchIsLeft||animAmmount+"px"},
{step:function(step){
//here i am trying to get how much px it has moved so far
currTopVal = step;
console.log("currTopVal", currTopVal);
// i get some numbers, and i have no idea from where it got them
}
},
calculatedSpeed);
}
所以我的主要问题是
我可以从传递给
步
方法?
它会回拨吗
每个
动画的间隔?