jQuery的缓动函数中有哪些不同的参数

jQuery的缓动函数中有哪些不同的参数

问题描述:

我在 https:// github上看到了jQuery的缓动功能。 com / danro / jquery-easing / blob / master / jquery.easing.js

我看到每个函数需要5个参数,但我无法计算了解所有这些是什么以及它们如何与 animate 的调用相关联。

I see each function takes 5 paramaters but I can't figure out what all of them are and how they tie into a call to animate.


  • x - ????

  • t - 当前时间 - new Date() ???

  • b - 起始值

  • c - 更改值???

  • d - 持续时间

  • x - ????
  • t - current time - new Date()???
  • b - the beginning value
  • c - change in value ???
  • d - duration

例如,我会调用类似的函数:

For example, I would call a function like:

$("div").width(50).animate({
    width: 150px
}, 2000);

这个电话会不会像这样匹配:

Would this call match up like so:


  • x - ????

  • t - 每次更新通话的当前时间

  • b - 50px

  • c - 100px

  • d - 2000

  • x - ????
  • t - the current time at each call to update
  • b - 50px
  • c - 100px
  • d - 2000


x是方程式不需要的额外参数,但是与jQuery兼容所必需的

x is an extra parameter not needed for the equations, but necessary for compatibility with jQuery

参考:链接

所以 x 等于 null t 以动画开始后的毫秒数表示

So x is equal to null and t is expressed in milliseconds since the start of the animation

我认为你有适用于其他人。

I think you have right for the others.

您可以查看此帖子更多理解