jQuery slideToggle() Method
jQuery slideToggle() Method
The slideToggle() method is used to toggle between slideUp() and slideDown() for the selected elements. If the element is hidden, it will use the slideDown() method to show it. If the element is present, it will use the slideUp() method to hide it. This is called the toggle effect.
Syntax:-
Its syntax is:- $(selector).slideToggle(speed, easing, callback)
Further Explanation:-
Parameter | Description |
---|---|
speed | Optional. Specifies the speed of the fading effect. The default is 400 milliseconds. |
easing | Optional. Specifies the speed of the element at different points of the animation. The default is swing. |
callback | Optional. A function to be executed after the slideToggle() method is completed. |