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

jQuery fadeIn() method

jQuery fadeIn() method

jQuery effects methods jQuery effects methods

Example

Display all with a fade-in effect

element:

$

(

"

button

"

)

.

click

(

function

(

)

{

$

(

"

p

"

)

.

fadeIn

(

)

;

}

)

;

Try it »


Definition and Usage

The fadeIn() method gradually changes the opacity of the selected elements, from hidden to visible (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 fadeOut() the method.

Syntax

$(

selector

).fadeIn(

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 fadeIn() method finishes.

    To learn more about callback, please visit our jQuery Callback chapter on callbacks.

    |

    Try it - Example

    fadeIn() - 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 displaying elements with a fade-in effect.


    jQuery effects methods jQuery effects methods