Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Easing functions in jQuery

Tags:

jquery

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?

like image 415
naveen Avatar asked Jul 07 '11 14:07

naveen


People also ask

What is the default easing used for jQuery animation?

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 .

What is swing in jQuery?

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.

What does an easing do?

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.

What is easing in Javascript?

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.


Video Answer


1 Answers

The standard library only has swing and linear, however, jquery UI brings in a ton more

like image 133
Marc Avatar answered Sep 28 '22 14:09

Marc