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:hidden
property.
$(selector).slideDown(speed,easing,callback)
speed
: An optional parameter that is used to specify the duration of the event of sliding down. It can be in milliseconds or slow
and fast
. 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: swing
and linear
, of which swing
is the default.
callback
: An optional parameter that is the callback
function which gets called once the sliding is over.
In the code below, the text "Best learning platform!"
gets shown as it slides down once the Slide Down
button is clicked.