Fading Elements In

$("img").fadeIn(1000, "swing");

The .fadeIn( [duration] [, easing] [, callback]) method provides the optional duration, easing, and callback options that allow you to animate fading the opacity of an element from its current value to 1.

For example, the following code applies an animation of 1 second with swing easing to all image elements:

$("img").fadeIn(1000, "swing");

Get jQuery and JavaScript Phrasebook 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.