Effects and animations

Custom animations and effects can be added to various elements to enhance your interface using varying designs and colors.

animate()

The animate() function uses some built-in animations to animate objects in and off the view.

Its syntax is as follows:

(selector).animate({styles},speed,easing,callback)

Parameters

The animate function accepts the parameters duration, easing, and callback.

The duration parameter is optional and is used to specify the speed of the hide and show effect. Its possible values are fast, slow, and milliseconds. The default is 400ms.

The easing parameter is optional and is used to specify the easing function that is to be used for the animation. The default is string.

The callback parameter too is optional ...

Get Web Developer's Reference Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.