Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery Effects fadeOut() method

jQuery Effect fadeOut() method

jQuery effects methods jQuery effects methods

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:

  • Millisecond
  • "slow"
  • "fast"
  • | | *easing* | Optional. Specifies the speed of the element at different points in the animation. The default is "swing".

    Possible values:

    **Tip:** More easing functions are available in extension plugins. | | *callback* | Optional. A function to be executed after the fadeOut() method finishes.

    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 jQuery effects methods