jQuery .fadeIn() Reveal Elements by Fading In

Beginner
7 min read
Updated: Oct 2026
5 examples
Live preview

What Is .fadeIn()?

.fadeIn() (since jQuery 1.0) displays matched elements by fading them to opaque (opacity 1). It unhides the element and animates opacity. Returns the jQuery object for chaining.

Remember
$("#book").fadeIn();                    // default 400 ms
$("#book").fadeIn("slow", function () { /* done */ });
$("#panel").fadeIn(600, "linear");

// Unhides + fades to opacity 1
// Unlike .fadeTo() — that does not unhide
NeedUse
Smooth reveal to opaque$el.fadeIn()
Instant show.show()
Fade out / hide.fadeOut()
Fade to a partial opacity.fadeTo()
Toggle fade either way.fadeToggle()

How to Use .fadeIn()

Hide the element first (or start with display: none), then call .fadeIn() from a click or other handler.

  1. Select the target ($("#book")).
  2. Ensure it is hidden (.hide() or CSS display: none).
  3. On a user action, call .fadeIn() (optional duration / easing / complete).
  4. jQuery restores display and animates opacity to 1.
  5. For spam clicks, chain .stop(true, true) before .fadeIn().
PieceRequired?Role
Matched setYesHidden elements to reveal
durationNoDefault 400; also "fast" (200) / "slow" (600)
easingNoDefault "swing"; built-in also "linear" (since 1.4.3)
completeNoRuns once per matched element when its fade ends
Return value—jQuery object (chainable)

Pseudocode

Pseudocode
call $(elements).fadeIn(duration?, easing?, complete?)

for each matched element:
    restore a visible display value
    animate opacity → 1 over duration

    if complete was provided:
        call complete once for this element
        (this = the DOM element)

return the jQuery set for chaining

Cheat Sheet

Keep these facts handy while building fade reveals.

TopicDetail
Syntax.fadeIn([duration] [, easing] [, complete])
Options form.fadeIn({ duration, easing, complete, … })
SincejQuery 1.0 · easing arg since 1.4.3
Default duration400 ms
Presets"fast" = 200 · "slow" = 600
Easingswing (default) · linear
CallbackOnce per element · use .promise() for “all done”
vs fadeTo.fadeIn() unhides · .fadeTo() does not
Rapid clicks$el.stop(true, true).fadeIn()

Live Preview

Click Run to fadeIn the sample panel. Change duration with the chips.

This paragraph fades in with .fadeIn().

Reset hides the panel so you can fade it in again. Each Run starts from hidden.

Result
Ready — click Run to fadeIn.

jQuery Examples

Short, copy-ready snippets. Open DevTools, or use Try It Yourself for a live editor.

Example 1 — Basic Slow Reveal

From the jQuery docs: fade in a hidden element on click with a complete callback.

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

How It Works

  1. Hidden start. #book begins with display: none.
  2. Click. The handler calls .fadeIn("slow", …).
  3. Unhide + fade. Display is restored; opacity tweens to 1.
  4. Callback. Fires once for that element when done.

Example 2 — Fade Hidden Divs One by One

Official demo: each click fades in the first remaining hidden div.

jQuery
$("#trigger").on("click", function () {
  $("div:hidden").first().fadeIn("slow");
});
Try It Yourself

How It Works

  1. Selector. div:hidden finds boxes still hidden.
  2. first. Only the next one is chosen.
  3. fadeIn. That box unhides over 600 ms.
  4. Repeat. Later clicks advance through the set.

Example 3 — Nested Fade in a Callback

Official pattern: fade a block in, then fade nested text in when the first fade finishes.

jQuery
$("a").on("click", function () {
  $(".overlay").fadeIn(3000, function () {
    $(".overlay span").fadeIn(100);
  });
  return false;
});
Try It Yourself

How It Works

  1. Outer. The overlay fades in for 3 seconds.
  2. Complete. The callback runs when that fade ends.
  3. Inner. The nested span fades in quickly (100 ms).
  4. Sequence. Callbacks are a simple way to chain reveals.

Example 4 — hide().fadeIn() Chain

Force a hidden start, then fade in — handy when the element may already be visible.

jQuery
$("#run").on("click", function () {
  $("#alert").hide().fadeIn(800, function () {
    $("#status").text("Fade in complete.");
  });
});
Try It Yourself

How It Works

  1. hide. Instant hide resets to a known start state.
  2. fadeIn. Animates opacity up over 800 ms.
  3. Repeatable. Works even if the alert was already visible.
  4. Callback. Updates status when the fade ends.

Example 5 — Linear Easing + Callback

Positional easing since jQuery 1.4.3 — constant-speed fade with a complete handler.

jQuery
$("#run").on("click", function () {
  $("#panel").hide();
  $("#panel").fadeIn(600, "linear", function () {
    $("#status").text("Complete — callback fired once per element.");
  });
});
Try It Yourself

How It Works

  1. Reset. .hide() ensures a fresh start.
  2. Duration. 600 is milliseconds.
  3. linear. Pace stays constant (vs default swing).
  4. Complete. Runs once for #panel.

Edge Cases & Pitfalls

CaseWhat happensFix
Already visible + opaqueLittle or no visible change.hide() first, or only call when hidden
Need partial opacity.fadeIn() always goes to opaqueUse .fadeTo()
Spam clicksQueued fades stack up.stop(true, true) before .fadeIn()
One callback for many elementsComplete fires per elementUse .promise().done()
jQuery.fx.offDuration becomes 0Respect reduced-motion / accessibility settings

Browser Support

.fadeIn() has been part of jQuery since 1.0 (easing argument since 1.4.3). It works in every browser that runs your loaded jQuery version.

✓ Stable · jQuery 1.0+

jQuery .fadeIn()

Supported across jQuery 1.x, 2.x, and 3.x. Prefer a current jQuery 3.x build. Start from a hidden element for a clear reveal.

100% With jQuery
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
.fadeIn() Universal

Bottom line: Safe for everyday UI reveals. Guard rapid clicks with .stop(true, true), and respect jQuery.fx.off for reduced motion.

Performance Notes

ApproachCostBest for
One element fadeInCheapPanels, alerts, help boxes
Many elements at onceMore paint workKeep sets small; prefer one container
Queued spam clicksWasted framesAlways .stop(true, true) on busy buttons

Opacity fades are inexpensive for a few elements. Cost climbs with large sets or stacked queues — stop before fade, and prefer fading one wrapper over dozens of children.

Key Takeaways

  • Role: unhide + fade to opaque — since jQuery 1.0.
  • Call: $el.fadeIn() — default 400 ms; optional easing + complete.
  • vs fadeTo: .fadeIn() unhides · .fadeTo() does not.
  • Guard: .stop(true, true) before fade on busy buttons.

One line: .fadeIn() reveals a hidden element by fading opacity to 1 — the smooth counterpart to .show().

Frequently Asked Questions

.fadeIn() displays matched elements by fading them to full opacity. It animates opacity toward 1 and restores a visible display value so hidden content becomes visible. Use it for a smooth reveal instead of an instant .show().
1) .fadeIn([duration] [, complete]) — optional duration and completion callback. 2) .fadeIn(options) — an options object with duration, easing, queue, step, progress, and Promise-style callbacks. 3) .fadeIn([duration] [, easing] [, complete]) — positional easing since jQuery 1.4.3.
.show() reveals instantly with no transition. .fadeTo() animates to a target opacity but does not unhide elements. .fadeOut() hides by fading to 0. .fadeIn() both unhides and fades to full opacity in one 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.
Once per matched element when that element’s fade finishes — not once for the whole set. Inside the callback, this is the DOM element. Use .promise().done() when you need a single callback after every element completes.
Yes for a visible effect. .fadeIn() is meant for hidden elements (typically display:none via .hide()). Calling it on already-visible, fully opaque elements has little noticeable effect.

Next: .fadeOut() Method

Hide elements by fading opacity to 0 — the counterpart to .fadeIn().

.fadeOut() tutorial →

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