jQuery hide/show Effect

tutorial and example
tutorial and example

jQuery provides a interface for doing various kind of amazing effects like Slide, Fade, Hide, Show, Toggle Effects and Animate.

jQuery hide() and show()

Using the jQuery show() and hide() methods, you can show and hide the HTML elements.

Syntax:

speed: Speed is an optional parameter. It is used to specify delay. Its value can be fast or slow and it is defined in milliseconds.

callback: Callback is an optional parameter. It represents a function to be executed after the completion of the hide or show method.

Example:

Try Now

jQuery toggle()

The jQuery toggle() method is used to make toggle between the hide() and show() method. It hides the shown element and shows the hidden elements.

Toggle() method is used to check the selected elements for visibility.

If an element is hidden then show() is run and if an element is visible then hide() is run.

Syntax:

speed: Speed is an optional parameter. It is used to specify delay. Its value can be fast or slow and it is defined in milliseconds.

callback: Callback is an optional parameter. It represent a function to be executed after the completion of the toggle() method.

Example:

Try Now