jQuery Effect fadeOut() method
Example
Hide all with a fade-out effect
element:
$
(
"
button
"
)
.
click
(
function
(
)
{
$
(
"
p
"
)
.
fadeOut
(
)
;
}
)
;
Try it »
Definition and Usage
The fadeOut() method gradually changes the opacity of the selected elements, from visible to hidden (a fading effect).
**Note:** Hidden elements will not be fully displayed (they no longer affect the page's layout).
**Tip:** This method is usually used together with fadeIn() the method.
Syntax
$(
selector
).fadeOut(
speed,easing,callback
)
| Parameters | Description |
|---|---|
| speed | Optional. Specifies the speed of the fading effect.
Possible values: |
Possible values:
- "swing" - Moves slowly at the beginning/end, and faster in the middle
- "linear" - Moves at a constant speed
To learn more about callback, please visit our jQuery Callback chapter on callbacks.
|Try it - Example
fadeOut() - Using the speed parameter
How to use the speed parameter to specify the speed of the fading effect.
fadeIn() - Using the callback parameter
How to use the callback parameter when gradually changing the opacity of the selected elements.
jQuery effects methods