fadeIn(), fadeOut(), fadeToggle() Methods in jQuery
fadeIn()
The fadeIn() method is used to fade in the visibility of the selected element.
Syntax:-
Its syntax is:- $(selector).fadeIn(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 fadeIn() method is completed. |
fadeOut()
The fadeOut() method is used to fade out the visibility of the selected element.
Syntax:-
Its syntax is:- $(selector).fadeOut(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 fadeOut() method is completed. |
fadeToggle()
The fadeToggle() method is used to fade in or out the visibility of the selected element.
Syntax:-
Its syntax is:- $(selector).fadeToggle(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 fadeToggle() method is completed. |