Easy Tutorial
❮ Misc Deferred Resolve Eff Show ❯

jQuery Effects - Sliding


jQuery sliding methods enable elements to slide up and down.

Click here to hide/show the panel.

Time is precious, so we provide quick and easy-to-understand learning content for you.

Here, you can acquire any knowledge you need through an accessible and convenient mode.


Examples

jQuery slideDown()

jQuery slideUp()

jQuery slideToggle()


jQuery Sliding Methods

With jQuery, you can create sliding effects on elements.

jQuery includes the following sliding methods:


jQuery slideDown() Method

The jQuery slideDown() method is used to slide down an element.

Syntax:

The optional speed parameter specifies the duration of the effect. It can take the following values: "slow", "fast", or milliseconds.

The optional callback parameter is the name of a function to be executed after the sliding completes.

The following example demonstrates the slideDown() method:

Example

$("#flip").click(function(){
  $("#panel").slideDown();
});

jQuery slideUp() Method

The jQuery slideUp() method is used to slide up an element.

Syntax:

The optional speed parameter specifies the duration of the effect. It can take the following values: "slow", "fast", or milliseconds.

The optional callback parameter is the name of a function to be executed after the sliding completes.

The following example demonstrates the slideUp() method:

Example

$("#flip").click(function(){
  $("#panel").slideUp();
});

jQuery slideToggle() Method

The jQuery slideToggle() method toggles between the slideDown() and slideUp() methods.

If the element is slid down, slideToggle() can slide them up.

If the element is slid up, slideToggle() can slide them down.

The optional speed parameter specifies the duration of the effect. It can take the following values: "slow", "fast", or milliseconds.

The optional callback parameter is the name of a function to be executed after the sliding completes.

The following example demonstrates the slideToggle() method:

Example

$("#flip").click(function(){
  $("#panel").slideToggle();
});
❮ Misc Deferred Resolve Eff Show ❯