jQuery .slideDown() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Effects

Definition

.slideDown() (since jQuery 1.0) displays matched elements with a sliding motion by animating height from 0 to full size. Content below shifts down to make room. Returns the jQuery object for chaining.

Syntax

Start with these common calls. Keep them short and readable.

jQuery
$("#panel").hide();                 // start hidden
$("#panel").slideDown();            // default 400 ms
$("#panel").slideDown("slow");      // 600 ms
$("#panel").slideDown(600, "linear", function () { /* done */ });

// Hidden → height grows → fully visible
// Content below slides down as height increases
CallWhat it does
.slideDown()Learn jQuery .slideDown(): reveal hidden elements with a sliding height animation since 1.0, duration presets, easing since 1.4.3, per-element callbacks, and compare with slideUp, show, fadeIn, and slideToggle.

Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.

Parameters

ParameterDescription
Step 1Start with a hidden element (.hide() or display: none).
Step 2On a user action, call .slideDown() (optional duration / easing / complete).
Step 3jQuery restores display and animates height from 0 to natural size.

Return Value

Return ValueDescription
Value / undefinedGetters usually return a value from the first matched element, or undefined when nothing applies.

jQuery Examples

Example 1 — Slow Reveal on Click

Official pattern: element starts hidden; click slides it down over 600 ms.

jQuery
$("#clickme").on("click", function () {
  $("#book").slideDown("slow", function () {
    // Animation complete.
  });
});
Try It Yourself

How It Works

  1. Hidden start. The target begins with display: none.
  2. Preset. "slow" means 600 ms.
  3. Tween. Height animates from 0 to natural size.

Example 2 — slideDown or .hide() (Official Ex. 1)

If the first box is hidden, slide all down; otherwise hide them instantly.

jQuery
$("#toggle").on("click", function () {
  if ($(".box").first().is(":hidden")) {
    $(".box").slideDown("slow");
  } else {
    $(".box").hide();
  }
});
Try It Yourself

How It Works

  1. Check. :hidden on the first box picks the branch.
  2. Reveal. Hidden → .slideDown("slow") on all boxes.
  3. Hide. Visible → .hide() with no animation.

Example 3 — slideDown with Per-Element Callback

Official idea: after each input finishes sliding, style it and focus the middle one.

jQuery
$("#push").on("click", function () {
  $("input").slideDown(1000, function () {
    $(this).attr("data-ready", "yes");
    $(this).filter(".middle").trigger("focus");
    $("#status").text("Slide finished for one input.");
  });
});
Try It Yourself

How It Works

  1. Duration. 1000 is one second in milliseconds.
  2. Per element. Three inputs → callback can run three times.
  3. this. Inside complete, this is the current input.

Frequently Asked Questions

.slideDown() displays matched elements with a sliding motion by animating height from zero to full size. Content below shifts down to make room. Use it for a vertical expand reveal instead of an instant .show().
1) .slideDown([duration] [, complete]) — optional duration and completion callback. 2) .slideDown(options) — an options object with duration, easing, queue, step, progress, and Promise-style callbacks. 3) .slideDown([duration] [, easing] [, complete]) — positional easing since jQuery 1.4.3.
.slideUp() collapses visible elements. .show() reveals instantly with no transition. .fadeIn() animates opacity, not height. .slideToggle() picks slideDown or slideUp from current visibility. .slideDown() only expands and shows.
Milliseconds, or the strings "fast" (200 ms) and "slow" (600 ms). Default is 400 ms when omitted.
Once per matched element when that element’s slide finishes — not once for the whole set. Use .promise().done() when you need a single callback after every element completes.
Yes. Start with display:none (or .hide()). Calling .slideDown() on already-visible elements has little effect because they are already expanded and shown.

Next: .slideUp() Method

Collapse visible content by animating height to zero — the exit counterpart to slideDown.

.slideUp() Method tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

10 people found this page helpful