jQuery的缓动函数中有哪些不同的参数 [英] what are the different parameters in jQuery's easing functions

查看:92
本文介绍了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.

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

这篇关于jQuery的缓动函数中有哪些不同的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆