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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.