Home » jQuery UI Toggle

jQuery UI toggle

The jQuery toggle() method is used to toggle the show() or hide() method depending on whether the element is hidden or not.

Syntax:

Parameters of toggle method:

  • Effect:This parameter specifies the effects which are used for transition.
  • Options: This is used for specifying the specific setting and easing for the effects. Each effect has its own set of options.
  • Duration:This specifies the time duration and indicates the number of milliseconds of the effect. Its default value is 400.
  • Complete:It is a callback method. It is called for each element when the effect is completed for the elements.

jQueryUI toggle example

Let’s take an example of jQueryUI toggle() method with explode effect:

Test it Now

Next TopicjQuery UI addClass

You may also like