jQuery native animation effects

  • 2020-07-21 06:57:55
  • OfStack

1. Method:


show : Displays the selected element. 
hide : Hides the selected element. 
toggle : Shows or hides the selected element. 
fadeIn : Gradually increases the opacity of the selected element to 100% . 
fadeOut : Gradually reduces the opacity of the selected element to 0% . 
slideDown : Slides down vertically to display the selected element. 
slideUp : Slides up vertically to hide the current element. 
slideToggle : To fold or expand a selected element by sliding vertically up or down. 

2. Grammar:

$(selector). Method name ([speed], [callback]);

-- speed: Optional, speed. The default "normal".

Value for

Milliseconds (say 1500)
"slow"
"normal"
"fast"
callback: Optional, callback function.

3. The call:


  $(".toggle").toggle();

  $(".toggle").toggle(250);

  $(".toggle").toggle('fast');

This is the end of this article, I hope you enjoy it.


Related articles: