.slideUp() (since jQuery 1.0) hides matched elements with a sliding motion by animating height to 0. Lower content slides up as items collapse. When height reaches 0, display: none frees layout space. Returns the jQuery object for chaining.
Remember
$("#panel").slideUp(); // default 400 ms
$("#panel").slideUp("slow"); // 600 ms
$("#panel").slideUp(600, "linear", function () { /* done */ });
// Visible → height shrinks → display: none
// Content below slides up as height decreases
Start with a visible element, then call .slideUp() from a click (or other) handler.
Select a visible target ($("#panel")).
On a user action, call .slideUp() (optional duration / easing / complete).
jQuery animates height from natural size down to 0.
When finished, display: none removes the element from layout.
Optional complete runs once per matched element when done.
Piece
Required?
Role
Matched set
Yes
Elements to collapse (should be visible)
duration
No
Default 400; also "fast" / "slow"
easing
No
Since 1.4.3 — swing (default) or linear
complete
No
Once per element when its slide ends
Return value
—
jQuery object (chainable)
Pseudocode
Pseudocode
call $(elements).slideUp(duration?, easing?, complete?)
for each matched element:
if already hidden:
little or no change
else:
animate height from natural height → 0
set display: none
content below slides up
if complete was provided:
call complete once for this element
(this = the DOM element)
return the jQuery set for chaining
Reference
Cheat Sheet
Keep these two facts handy while building slide collapses.
Topic
Detail
Syntax
.slideUp([duration] [, easing] [, complete])
Options form
.slideUp({ duration, easing, complete, … })
Since
jQuery 1.0 (easing arg since 1.4.3)
Default duration
400 ms
Presets
"fast" = 200 · "slow" = 600
Easing
swing (default) · linear
End state
display: none when height reaches 0
Related
.slideDown() · .slideToggle()
Try it
Live Preview
Run slideUp on the sample panel. Use Reset to show it again.
This panel slides up and hides. Reset restores it.
Run a slideUp, then Reset to show the panel again for another try.
Result
Ready — click Run to slideUp.
Code
jQuery Examples
Short, copy-ready snippets. Open DevTools, or use Try It Yourself for a live editor.
Example 1 — Slow Collapse on Click
Official pattern: element starts shown; click slides it up over 600 ms.
jQuery
$("#clickme").on("click", function () {
$("#book").slideUp("slow", function () {
// Animation complete.
});
});
Drawer collapses at steady linear pace over 600 ms
Callback updates the text when finished
Built-in easing: swing (default) or linear
How It Works
Duration.600 ms total.
Easing."linear" keeps a constant rate.
Collapse. Height goes to 0, then display: none.
Complete. Updates text when the tween ends.
Edge Cases & Pitfalls
Watch these when collapses feel wrong or “do nothing.”
hidden
Already hidden → little effect
Call .slideUp() on visible elements. Hidden ones are already collapsed.
callback
Complete runs once per element
Collapsing three panels fires the callback three times. Use .promise().done() for one “all finished” hook.
display
Ends at display: none
After height hits 0, the element leaves the layout — that is intended.
queue
Rapid clicks queue animations
Use .stop(true, true) before .slideUp() on busy dismiss buttons.
fx.off
jQuery.fx.off skips the tween
When true, collapses snap shut instantly (duration 0).
Compatibility
Browser Support
.slideUp() has been part of jQuery since 1.0 (positional easing since 1.4.3). It works in every browser that runs your loaded jQuery version — no separate browser feature flag.
✓ Stable · jQuery 1.0+
jQuery .slideUp()
Supported across jQuery 1.x, 2.x, and 3.x. Prefer a current jQuery 3.x build. Height animation uses jQuery’s fx engine.
100%With jQuery
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
.slideUp()Universal
Bottom line: Safe for dismissals, alerts, and panels. Guard rapid clicks with .stop(true, true), and respect jQuery.fx.off for reduced motion.
Analysis
Performance Notes
Approach
Cost
Best for
One panel slideUp
Cheap
Alerts, banners, dismiss boxes
Many elements at once
More layout work
Prefer one wrapper when possible
Queued spam clicks
Wasted frames
Always .stop(true, true) on dismiss
Height collapses trigger layout. One container is cheaper than sliding dozens of siblings — and stopping before collapse avoids stacked hide queues.
Remember
Key Takeaways
Role: animated hide via height → display: none — since jQuery 1.0.
Pair:.slideDown() to reopen; .slideToggle() for both directions.
Guard: element must be visible; stop queues on busy buttons.
One line:.slideUp() collapses a visible element by animating height to 0, then sets display: none.
Frequently Asked Questions
.slideUp() hides matched elements with a sliding motion by animating height to zero. Lower page content slides up as items collapse. When height reaches 0 (or min-height), display is set to none so the element no longer affects layout.
1) .slideUp([duration] [, complete]) — optional duration and completion callback. 2) .slideUp(options) — an options object with duration, easing, queue, step, progress, and Promise-style callbacks. 3) .slideUp([duration] [, easing] [, complete]) — positional easing since jQuery 1.4.3.
.slideDown() reveals by animating height open. .hide() removes instantly with no transition. .fadeOut() animates opacity, not height. .slideToggle() picks slideDown or slideUp from current visibility. .slideUp() only collapses and hides.
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 a visible element that takes up layout space. Calling .slideUp() on already-hidden elements has little visible effect.