December 2013
Intermediate to advanced
384 pages
9h 54m
English
$("img").fadeToggle(3000, "swing");
The .fadeToggle( [duration] [, easing] [, callback]) method provides the optional duration, easing, and callback options, allowing you to animate fading the opacity of an element from its current value to 0, depending on its current value.
For example, the following code applies an animation of 3 seconds with swing easing to all image elements. Images that are currently visible are faded out, and images that are currently transparent are faded in:
$("img").fadeToggle(3000, "swing");
Read now
Unlock full access