jQuery slideDown and slideUp methods with examples

jQuery Slide

jQuery provides slide methods to slide elements of your document. This jquery slider tutorial guides you through the syntax of slide methods with examples.

Using slideDown() method

Syntax

$(selector).slideDown(speed,callback);

  • Where selector = An element to slide down, that can be p, div etc.
  • Speed = This can be given value in milliseconds, “fast” or “slow”
  • Callback = An optional argument, function that will be executed after sliding completes

For example:

$(“#slider”).slideDown(“slow”);

Running Example of slideDown method

jQuery slideDown

Experience this example online

Using slideUp() method

Syntax

$(selector).slideUp(speed,callback);

  • Where selector = An element to slide up, that can be p, div etc.
  • Speed = This can be given value in milliseconds, “fast” or “slow”
  • Callback = An optional argument, function that will be executed after sliding completes

For example:

$(“#slider”).slideUp(“slow”);

Running Examples of slideUp method

jQuery slideUp

Experience this example online

Also see