December 2013
Intermediate to advanced
384 pages
9h 54m
English
$("img").fadeTo(2000, .5); $("img").fadeTo(2000, 1); $("img").fadeTo(2000, .1);
The .fadeTo( duration, opacity [, easing] [, callback]) method provides the duration and opacity options that specify a specific opacity to end at and how long to animate the transition. It also provides optional easing and callback arguments.
For example, the following code applies an animation of 2 seconds for all images to transition from the current opacity to .5:
$("img").fadeTo(2000, .5);
Read now
Unlock full access