Sliding Effects

Explore the sliding effects in jQuery such as slideUp(), slideDown(), and slideToggle(), along with relevant examples.

Sliding effects slide certain elements up and down on a webpage. The relevant effects are discussed in detail below.

slideUp() effect

Given a selector, the slideUp() effect slides up and hides the set of matched elements from a webpage. We can also provide an optional speed parameter to control the sliding speed.

In the “Slide Up” button event handler example below, we slide up the div element in 2000 ms using the slideUp() effect in line 3.

Get hands-on with 1200+ tech skills courses.