How to toggle the fading using jQuery fade function?
Basically the fading is the appearing and disappearing the content or section gradually. While toggle means if already appeared then set it to fade out and similarly if already not appeared then appear it with fade in.
We mostly perform toggling with button click.
Syntax of jQuery fadeToggle() function
$("TagSelector").fadeToggle("OptionalTimeParameter"); // Syntax
$("#mydiv").fadeToggle("slow"); // Example
Lets discuss full detail example that we show that how actually the toggle fading works.
jQuery fadeToggle() function
We will call a jQuery fade Toggle function on button click and fade in and out the div section with id="mydiv".
Output of jQuery fadeToggle()
You are at the CodingPK jQuery Fade Toggle tutorial.
Just follow the Chapter Sequence to learn jQuery programming.
Note ! fadeIn() , fadeOut() , fadeToggle() functions parameter is optional , you can pass null value or time value. For example