hide(),show(),toggle() methods in jQuery
hide()
The hide() method is used to hide the selected element.
Syntax:-
Its syntax is:- $(selector).hide(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 hide() method is completed. |
show()
The show() method is used to show the selected element.
Syntax:-
Its syntax is:- $(selector).show(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 show() method is completed. |
toggle()
The toggle() method is used to show/hide the selected element.
Syntax:-
Its syntax is:- $(selector).toggle(speed, easing, callback)
Further Explanation:-
Parameter | Description |
---|---|
speed | Optional. Specifies the speed of the effect. |
easing | Optional. Specifies the speed of the element in different points of the animation. Default is swing |
callback | Optional. A function to be executed after the toggle() method is completed |