Using jQuery fadeToggle method to fadein and fadeout elements of document

The fadeToggle () method

To allow users to show and hide elements of website with fading effects, fadeToggle method can be used. jquery fadeToggle method will fadein if elements were fadeout and vice versa.

You may use fadeToggle to show and hide images, menus, table of content etc. Show and hide methods would also do this without fading effects.

Syntax of fadeToggle jquery

Following the syntax of fadetoggle in jquery:

$(selector). fadeToggle (speed,callback);

Running Example of fadeToggle() method

Following example shows how fadetoggle jquery method works to show and hide elements with fading effect.

Experience this example online


Also see jquery fadeOut() method | jquery fadeIn() method | jquery fadeTo() method

Was this article helpful?

Related Articles

Leave A Comment?