jQuery .fadeOut() Method

Beginner
⏱️ 9 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Opacity Exit

What You’ll Learn

The .fadeOut() instance method hides matched elements by fading them to transparent. This tutorial covers all three overloads since jQuery 1.0 (including easing since 1.4.3), default and preset durations, per-element callbacks, comparisons with .hide(), .fadeIn(), .fadeTo(), and .animate({ opacity }), and five hands-on examples from the official jQuery API.

01

Hide

Visible → transparent

02

Duration

ms, fast, slow

03

Three overloads

Positional / options

04

Easing

Since 1.4.3

05

Callbacks

Once per element

06

fx queue

Chain with fadeIn

Introduction

Instant .hide() removes content in one frame. When you want a softer exit — a tooltip vanishing, modal overlay dissolving, or notification sliding away gracefully — .fadeOut() is the shorthand jQuery effect for that job.

Available since jQuery 1.0, .fadeOut() animates opacity toward transparent, then sets display: none so the element no longer affects layout. It enqueues on the default fx queue like other effects, which means you can chain it before .fadeIn(), after .delay(), or alongside another animation for readable sequential hide-and-show choreography.

Understanding the .fadeOut() Method

Per the official jQuery API, .fadeOut() hides matched elements by fading them to transparent. Once opacity reaches 0, the display style property is set to none, so the element no longer affects the layout of the page.

Elements should start visible. The method tweens opacity from 1 toward 0 over the duration you supply, then removes the element from the layout flow with display: none.

💡
Beginner Tip

Think of .fadeOut() as the polite exit to .fadeIn()’s entrance. Show content first, fade out when done — one line replaces manual opacity and display juggling.

📝 Syntax

Three overloads of .fadeOut:

jQuery
// 1) Duration and complete callback
jQuery( selector ).fadeOut( [duration ] [, complete ] )
// 2) Options object — queue, step, Promise callbacks
jQuery( selector ).fadeOut( options )
// 3) Duration, easing, complete — since jQuery 1.4.3
jQuery( selector ).fadeOut( [duration ] [, easing ] [, complete ] )

Parameters

  • duration (Number or String, default 400) — milliseconds, or "fast" (200) / "slow" (600).
  • easing (String, default "swing", since 1.4.3) — built-in swing or linear; plugins add more.
  • complete (Function) — called once per matched element when that element’s fade finishes.
  • options.queue (Boolean or String, default true) — false runs immediately; string names a custom queue.
  • options.step, progress, start, done, fail, always — same Promise-style hooks as other effects (since 1.8).

Return value

  • A jQuery object for chaining further queued methods on the same set.

Official jQuery API description

jQuery
// With the element initially shown, hide it slowly:
$( "#clickme" ).on( "click", function() {
  $( "#book" ).fadeOut( "slow", function() {
    // Animation complete.
  });
});

⚡ Quick Reference

GoalCode
Default 400 ms hide$el.fadeOut()
Slow hide (600 ms)$el.fadeOut("slow")
Custom duration + callback$el.fadeOut(800, function() { ... })
Linear easing since 1.4.3$el.fadeOut(600, "linear", function() { ... })
Options overload$el.fadeOut({ duration: 500, easing: "linear", complete: fn })
Toggle loop with fadeIn$el.fadeOut(400).fadeIn(400)

📋 .fadeOut() vs fadeIn vs hide vs fadeTo vs .animate({ opacity })

Five ways to change visibility — only .fadeOut() fades to transparent and sets display: none in one shorthand call.

.fadeOut()
$el.fadeOut("slow")

Fades visible elements to transparent then hides with display:none — preset exit shorthand

.fadeIn()
$el.fadeIn("slow")

Opposite reveal — unhides and fades to full opacity; pair with .fadeOut() for toggle UX

.hide()
$el.hide()

Instant removal with no opacity transition — use when animation is not needed

.fadeTo()
$el.fadeTo(400, 0.5)

Animates to a specific opacity level but does not hide — element stays in current display state

.animate({ opacity })
.animate({ opacity: 0 }, 400)

Custom opacity tween — does not auto-set display:none; call .hide() in callback if needed

Examples Gallery

Each example demonstrates an official jQuery API .fadeOut() pattern. Open DevTools or use the Try-it links. All five mirror live demos on api.jquery.com/fadeOut/.

📚 Getting Started

Official jQuery API demos — basic click-to-hide and paragraph fade-out patterns.

Example 1 — Basic Usage: Visible #book fadeOut("slow") on Click

With the element initially shown, click #clickme to fade out #book over the slow preset (600 ms) with a completion callback.

jQuery
// With the element initially shown, we can hide it slowly:
$( "#clickme" ).on( "click", function() {
  $( "#book" ).fadeOut( "slow", function() {
    // Animation complete.
  });
});
Try It Yourself

How It Works

.fadeOut("slow") maps to 600 milliseconds. jQuery animates opacity from 1 to 0, sets display: none, and fires the callback once per matched element when done.

Example 2 — All Paragraphs Fade Out on Click (Official Example 1)

Click any paragraph to fade out all p elements over the slow preset (600 ms).

jQuery
$( "p" ).on( "click", function() {
  $( "p" ).fadeOut( "slow" );
});
Try It Yourself

How It Works

The handler targets every paragraph in the document. Each matched element gets its own fade animation on the fx queue, all completing within the slow preset duration.

📈 Advanced Patterns

Callback cleanup, easing comparison, and toggle or dismiss notification patterns.

Example 3 — Span fadeOut(1000) Removes Element and Logs (Official Example 2)

Click a span to fade it out over 1000 ms; in the callback, log its text to a div and remove the span from the DOM.

jQuery
$( "span" ).on( "click", function() {
  $( this ).fadeOut( 1000, function() {
    $( "div" ).text( "'" + $( this ).text() + "' has faded!" );
    $( this ).remove();
  });
});
Try It Yourself

How It Works

The complete callback runs after opacity reaches 0 and display is set to none. Inside it, this refers to the faded DOM element — ideal for logging and cleanup without a separate selector.

Example 4 — #box1 linear vs #box2 swing fadeOut(1600) with Reset (Official Example 3)

Click fade out to compare linear easing on #box1 versus default swing on #box2 over 1600 ms. Show button resets both boxes.

jQuery
$( "#btn1" ).on( "click", function() {
  function complete() {
    $( "<p>" ).text( this.id ).appendTo( "#log" );
  }
  $( "#box1" ).fadeOut( 1600, "linear", complete );
  $( "#box2" ).fadeOut( 1600, complete );
});
$( "#btn2" ).on( "click", function() {
  $( "div" ).show();
  $( "#log" ).empty();
});
Try It Yourself

How It Works

Since jQuery 1.4.3, the middle argument names an easing function. Built-in options are swing (default, accelerates mid-animation) and linear (constant rate). The shared callback logs each box id when its fade completes.

Example 5 — fadeOut().fadeIn() Toggle Loop or Dismiss Notification

Toggle visibility with a chained .fadeOut().fadeIn() loop, or dismiss a notification permanently with .fadeOut() and .remove() in the callback.

jQuery
// Toggle loop — hide then show again on fx queue
$( "#toggle-btn" ).on( "click", function() {
  $( "#panel" ).fadeOut( 400 ).fadeIn( 400 );
});

// Dismiss notification — remove from DOM after fade
$( "#dismiss-btn" ).on( "click", function() {
  $( "#notification" ).fadeOut( 300, function() {
    $( this ).remove();
  });
});
Try It Yourself

How It Works

Chaining .fadeOut().fadeIn() enqueues both steps on the fx queue for a blink-style toggle. The dismiss pattern uses the callback to remove the element after the exit animation — cleaner than instant .hide() when you want a graceful goodbye.

🚀 Common Use Cases

  • Modal and overlay exits — fade out dimmed backdrops and dialog panels before removing them from the DOM.
  • Dismissible notifications — fade out toast messages, then .remove() in the callback for permanent cleanup.
  • Progressive removal — fade out list items one at a time on user interaction for staggered exits.
  • Image galleries — cross-fade captions or thumbnails by fading out the current slide before showing the next.
  • Interactive text — click-to-fade paragraphs or spans as in the official API demos.
  • Effect chains — combine with .delay() and .fadeIn() for full show/hide choreography on the fx queue.

🧠 How .fadeOut() Hides an Element

1

Element starts visible

Target must be visible and rendered. Already-hidden elements are skipped to avoid unnecessary DOM work.

Prerequisite
2

Opacity animates toward 0

jQuery tweens opacity from full visibility toward transparent over your chosen duration and easing curve.

Tween
3

Display set to none

Once opacity reaches 0, jQuery sets display: none so the element no longer affects page layout.

Hide
4

Hidden and callback

Element ends hidden at opacity 0 with display: none. complete fires once per matched element; fx queue advances to the next step.

📝 Notes

  • Available since jQuery 1.0; easing overload added in 1.4.3; Promise callbacks in options since 1.8.
  • Default duration is 400 ms; "fast" = 200 ms, "slow" = 600 ms.
  • Once opacity reaches 0, display is set to none so the element no longer affects layout.
  • Callbacks fire once per matched element — use .promise().done() for one set-level callback.
  • Will not hide elements already considered hidden — see the jQuery :hidden selector for details.
  • Set jQuery.fx.off = true globally to disable all effects including .fadeOut() (duration becomes 0).

Browser Support

.fadeOut() is a jQuery instance method since 1.0+. It uses jQuery’s internal fx engine and opacity tweens — behavior is consistent wherever jQuery runs, independent of CSS transition support.

Stable · jQuery 1.0+

jQuery .fadeOut()

Supported in all jQuery 1.x, 2.x, 3.x, and 4.x releases. Works in Chrome, Firefox, Safari, Edge, IE 6+ (with compatible jQuery builds), and Node.js via jsdom.

100% jQuery fadeOut API support
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
.fadeOut() Universal

Bottom line: Learn .fadeOut() alongside .fadeIn(), .delay(), and .queue() to build polished hide and reveal sequences in legacy and modern jQuery apps.

Conclusion

The .fadeOut() method is jQuery’s shorthand for hiding visible elements with an opacity transition to transparent, then setting display: none. Three overloads cover simple durations, options objects, and easing since 1.4.3.

Start with visible elements, pick your duration or preset, and use the complete callback to chain follow-up effects or remove DOM nodes. Pair this method with .fadeIn() behind you and .queue() ahead to master the full fx pipeline.

💡 Best Practices

✅ Do

  • Ensure elements are visible before calling .fadeOut()
  • Use "slow" / "fast" for readable preset timing across your app
  • Chain .fadeOut().fadeIn() for blink-style toggle effects on the fx queue
  • Use the complete callback to .remove() elements or enqueue the next effect
  • Call .promise().done() when you need one callback after all elements finish

❌ Don’t

  • Expect hidden elements to animate — .fadeOut() skips already-hidden content
  • Use .fadeOut() when you need a partial opacity — choose .fadeTo() instead
  • Replace .fadeOut() with .animate({ opacity: 0 }) without handling display in a callback
  • Assume one callback covers the whole set — it fires per matched element
  • Forget jQuery.fx.off in tests — it zeroes duration for all effects globally

Key Takeaways

Knowledge Unlocked

Five things to remember about .fadeOut()

Shorthand hide by fading visible elements to transparent.

5
Core concepts
02

Three overloads

Positional / options

API
🔄 03

400 / fast / slow

Default durations

Timing
📝 04

Per-element cb

Not once per set

Callback
👁 05

Start visible

Skips hidden

Rule

❓ Frequently Asked Questions

.fadeOut() hides matched elements by fading them to transparent. It animates opacity toward 0, then sets display to none so the element no longer affects page layout. Use it when you want a smooth exit instead of an instant .hide().
1) .fadeOut([duration] [, complete]) — optional duration and completion callback. 2) .fadeOut(options) — an options object with duration, easing, queue, step, progress, and Promise-style callbacks. 3) .fadeOut([duration] [, easing] [, complete]) — positional easing since jQuery 1.4.3.
.hide() removes elements instantly with no transition. .fadeIn() is the opposite reveal — unhides and fades to full opacity. .fadeTo() animates to a specific opacity but does not hide. .fadeOut() both fades to transparent and sets display:none in one shorthand call.
Duration is in milliseconds. Default is 400 ms when omitted. The strings "fast" (200 ms) and "slow" (600 ms) map to preset speeds, the same as other jQuery effect methods.
The complete callback runs once per matched element when that element's fade finishes — not once for the entire set. Use .promise().done() when you need a single callback after all elements complete.
No. To avoid unnecessary DOM manipulation, .fadeOut() will not hide an element that is already considered hidden (typically display:none). Calling it on hidden content produces little or no visible effect.
Did you know?

The official jQuery .fadeOut() span demo runs a 1000 ms fade, then calls .remove() inside the completion callback after logging the text. That pattern — graceful fade exit, permanent DOM cleanup in the callback — is one of the most copied dismiss tricks in the entire effects API, and it needs no setTimeout at all.

Continue to .fadeTo()

Animate to a specific opacity value without hiding the element from layout.

.fadeTo() →

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.

6 people found this page helpful