Appendix M. Effects

Speed

In the following table, the speed argument of each method means that any one of "slow", "normal", "fast", or the time specified in milliseconds can be specified for that argument.

Callback Function

An optional callback function may be provided in the second argument. If a callback function is provided, it is executed when the animation completes.

Method

Description

Return Value

Showing and Hiding Methods

show()

Displays each selected element if the element is hidden.

jQuery

show(speed, function)

Displays each selected element using an animation (see "Speed" and "Callback Function").

jQuery

show(effect, options, speed, function)

Uses a specific effect on an element to show the element if the first argument is an effect string (see "Effects").

jQuery

hide()

Hides each selected element if the element is not already hidden.

jQuery

hide(speed, function)

Hides each selected element using an animation (see "Speed" and "Callback Function").

jQuery

hide(effect, options, speed, function)

Uses a specific effect on an element to hide the element if the first argument is an effect string (see "Effects").

jQuery

toggle()

Toggles each selected element between displayed and hidden.

jQuery

toggle(speed, function)

Toggles each selected element between displayed and hidden using an animation (see "Speed" and "Callback Function").

jQuery

toggle(effect, options, speed, function)

Uses a specific effect on an element to toggle the element if the first argument is an effect string (see "Effects").

jQuery

effect( ...

Get Beginning JavaScript® and CSS Development with jQuery now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.