Hide and Show Effects in jQuery:

In jQuery there are so many effects available which will help you to create your web site more attractive and dynamic.
To hide or show the HTML element you have the hide() and show() methods in jQuery.

Syntax:

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

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

There are two parameters in hide() and show() method and they are optional so you can directly use hide() and show() methods

  • Speed: The speed parameter specifies the speed of hiding and showing the HTML element; and it take following values: “slow”, “fast” and “milliseconds”
  • Callback: The callback parameter will executed after the hide() and show() method completes.

Example:

toggle() in jQuery:

If you want to do hide and show functionality by clicking only one button so that “toggle()” method is available in jQuery.

With the help of toggle method you can perform hide and show methods.

Syntax:

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

There are two parameters in toggle() method.

  • Speed: The speed parameter specifies the speed of hiding and showing the HTML element; and it take following values: “slow”, “fast” and “milliseconds”
  • Callback: The callback parameter will executed after the toggle() method completes.

Example:

 

One response to “Hide and Show Effects in jQuery”

  1. louis vuitton outlet says:

    I aquired photovault the other day and i also should declare We are Pleased by it. The ipod device touch’s photography gallery ended up being relatively substandard i believe… THIS in contrast is great. My spouse and i did not very require the capability to password items off (though it truly is neat)- personally I got myself it so I might truly manage my pictures and never having to lay on a computer produce ringbinders applying itunes (VERY inconvenient).

Leave a Reply

Your email address will not be published. Required fields are marked *