What is the slideDown() method in jQuery?
In jQuery, the slideDown() method is used to slide down and show an element in the jQuery collection. The elements can also be hidden elements that are either hidden using jQuery methods or using the display:none property in CSS.
This function cannot be used to show hidden elements that have been hidden using the
visibility:hiddenproperty.
Syntax
$(selector).slideDown(speed,easing,callback)
Parameters
-
speed: An optional parameter that is used to specify the duration of the event of sliding down. It can be in milliseconds orslowandfast. The default value is 400 milliseconds. -
easing: An optional parameter that specifies the speed of the element in different points of the animation. The possible values are:swingandlinear, of whichswingis the default. -
callback: An optional parameter that is thecallbackfunction which gets called once the sliding is over.
Code
In the code below, the text "Best learning platform!" gets shown as it slides down once the Slide Down button is clicked.