简体   繁体   English

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

[英]what are the different parameters in jQuery's easing functions

I see jQuery's easing functions at https://github.com/danro/jquery-easing/blob/master/jquery.easing.js . 我在https://github.com/danro/jquery-easing/blob/master/jquery.easing.js上看到了jQuery的缓动函数。

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 . 我看到每个函数需要5个参数,但我无法弄清楚它们是什么,以及它们如何关联到animate调用中。

  • x - ???? x -????
  • t - current time - new Date() ??? t当前时间- new Date() ???
  • b - the beginning value b起始值
  • c - change in value ??? c值变化???
  • d - duration d持续时间

For example, I would call a function like: 例如,我将调用类似的函数:

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

Would this call match up like so: 这个电话会像这样匹配吗:

  • x - ???? x -????
  • t - the current time at each call to update t每次更新的当前时间
  • b - 50px b -50像素
  • c - 100px c -100像素
  • d - 2000 d -2000

x is an extra parameter not needed for the equations, but necessary for compatibility with jQuery x是方程式不需要的额外参数,但与jQuery兼容时必需

Reference : link 参考: 链接

So x is equal to null and t is expressed in milliseconds since the start of the animation 所以x等于nullt表示自动画开始以来的毫秒数

I think you have right for the others. 我认为您有权争取其他人。

You can see this post for more comprehension 您可以查看此帖子以获取更多理解

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM