This question sounds too trivial, but I could not find the answer anywhere.
I was browsing through the jQuery docs and saw some signatures like this.
.show( [duration,] [easing,] [callback] )
and
.animate( properties, [duration,] [easing,] [complete] )
At both places, easing is defined as
easing A string indicating which easing function to use for the transition.
But I don't see any documentation showing all the easing functions in jQuery.
From where will I get all the easing functions for jQuery?
An easing function specifies the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing , and one that progresses at a constant pace, called linear .
jQuery core ships with two easings: linear , which progresses at a constant pace throughout the animation, and swing (jQuery core's default easing), which progresses slightly slower at the beginning and end of the animation than it does in the middle of the animation.
Easing out causes the animation to start more quickly than linear ones, and it also has deceleration at the end. Easing out is typically the best for user interface work, because the fast start gives your animations a feeling of responsiveness, while still allowing for a natural slowdown at the end.
Easing functions work well in loops, when a new time is applied constantly. But you could also use them to calculate the position of an object at a specific time or frame. The function will return the eased value.
The standard library only has swing
and linear
, however, jquery UI brings in a ton more
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With