The jQuery fadeIn()
method is used to fade in a hidden element.
$(selector).fadeIn(speed, callback);
speed
is an optional parameter used to specify the duration of any applied effect. It can take on values such as “slow”, “fast”, or any other specified integer value of speed (in milliseconds).
callback
is another optional parameter that refers to a function that a user may want to execute at the end of fading.
The jQuery fadeOut()
method is used to fade out a visible element.
$(selector).fadeOut(speed, callback);
speed
is an optional parameter used to specify the duration of any applied effect. It can take on values such as “slow”, “fast”, or any other specified integer value of speed (in milliseconds).
callback
is another optional parameter that refers to a function a user may want to execute at the end of fading.
Let’s visualize the workings of fadeIn()
and fadeOut()
:
Free Resources