jQuery slideDown: Main Tips
- The
.slideDown()method shows the element with a jQuery slide down animation. - It belongs to a bigger group of jQuery slide effects.
- To learn how to make a slide up animation to hide an element, visit this tutorial.
Creating a Sliding Animation
The jQuery .slideDown() method shows the element with a slide down animation. This function can display elements hidden with the jQuery .hide() or .slideUp().
In the example below, a hover event reveals a hidden logo:
The syntax for jQuery .slideDown() is as follows:
$("selector").slideDown(length, easing, callback);
jQuery .slideDown() takes three arguments:
lengthdefines how many milliseconds does the animation last.400by default. Keywordsslow(600 ms) orfast(200 ms) can be used as well.easingindicates whether the speed of the animation should belinearorswing(default value).callbacknames a function that will run after the animation ends.
Note: jQuery .slideDown() doesn't affect elements that have their CSS style visibility set to none.