Effect methods

These effect methods may be used to perform animations on DOM elements. The effect methods are discussed in detail in Chapter 4, Styling and Animating.

Predefined effects

Effect method

Description

.show()

Displays the matched elements.

.hide()

Hides the matched elements.

.show(speed, [callback])

Displays the matched elements by animating height, width, and opacity.

.hide(speed, [callback])

Hides the matched elements by animating height, width, and opacity.

.toggle([speed], [callback])

Displays or hides the matched elements.

.slideDown([speed], [callback])

Displays the matched elements with a sliding motion.

.slideUp([speed], [callback])

Hides the matched elements with a sliding motion.

.slideToggle([speed], ...

Get Learning jQuery - Fourth Edition 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.