jQuery .fadeIn() Method

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

What You’ll Learn

The .fadeIn() instance method displays matched elements by fading them to opaque. 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 .show(), .fadeOut(), .fadeTo(), and .animate({ opacity }), and five hands-on examples from the official jQuery API.

01

Reveal

Hidden → opaque

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 hide

Introduction

Instant .show() makes content appear in one frame. When you want a softer entrance — a tooltip, modal overlay, or gallery image materializing gradually — .fadeIn() is the shorthand jQuery effect for that job.

Available since jQuery 1.0, .fadeIn() animates opacity toward full visibility and handles the display property so hidden elements become shown. It enqueues on the default fx queue like other effects, which means you can chain it after .hide(), .delay(), or another animation for readable sequential reveals.

Understanding the .fadeIn() Method

Per the official jQuery API, .fadeIn() displays matched elements by fading them to opaque. It is similar to .fadeTo(), but unlike .fadeTo(), .fadeIn() unhides the element and always targets full opacity.

Elements should start hidden — typically via .hide() or CSS display: none. The method tweens opacity from 0 to 1 over the duration you supply, then leaves the element visible at full opacity.

💡
Beginner Tip

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

📝 Syntax

Three overloads of .fadeIn:

jQuery
// 1) Duration and complete callback
jQuery( selector ).fadeIn( [duration ] [, complete ] )
// 2) Options object — queue, step, Promise callbacks
jQuery( selector ).fadeIn( options )
// 3) Duration, easing, complete — since jQuery 1.4.3
jQuery( selector ).fadeIn( [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 hidden, show it slowly:
$( "#clickme" ).on( "click", function() {
  $( "#book" ).fadeIn( "slow", function() {
    // Animation complete.
  });
});

⚡ Quick Reference

GoalCode
Default 400 ms reveal$el.fadeIn()
Slow reveal (600 ms)$el.fadeIn("slow")
Custom duration + callback$el.fadeIn(800, function() { ... })
Linear easing since 1.4.3$el.fadeIn(600, "linear", function() { ... })
Options overload$el.fadeIn({ duration: 500, easing: "linear", complete: fn })
Alert-style hide then reveal$el.hide().fadeIn(800)

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

Five ways to change visibility — only .fadeIn() unhides and fades to full opacity in one shorthand call.

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

Unhides hidden elements and animates opacity to 1 — preset reveal shorthand

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

Opposite exit — fades to transparent then hides; pair with .fadeIn() for toggle UX

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

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

.show()
$el.show()

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

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

Custom opacity tween — does not auto-handle display; call .show() first if hidden

Examples Gallery

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

📚 Getting Started

Official jQuery API demos — basic click-to-reveal and sequential hidden div fades.

Example 1 — Basic Usage: Hidden #book fadeIn("slow") on Click

With the element initially hidden, click #clickme to fade in #book over the slow preset (600 ms).

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

How It Works

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

Example 2 — Hidden Divs Fade In One by One (Official Example 1)

Each body click reveals the first still-hidden div with .fadeIn("slow"), producing a sequential color-block entrance.

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

How It Works

$("div:hidden").first() selects only the next hidden block. Rapid clicks enqueue separate fades on the fx queue, so animations can stack if you click faster than 600 ms.

📈 Advanced Patterns

Callback chaining, alert-style reveals, and easing since jQuery 1.4.3.

Example 3 — CENSORED Overlay Then Span Reveal (Official Example 2)

Click the link to fade in a red CENSORED! overlay over 3000 ms, then quickly fade in replacement text in the callback.

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

How It Works

The complete callback runs after the overlay div finishes — ideal for stringing a slow dramatic fade followed by a quick text reveal without nested timers.

Example 4 — Chained hide().fadeIn(800) Alert-Style Reveal

Reset visibility instantly with .hide(), then enqueue a smooth 800 ms fade when the user clicks a button — common modal and notification pattern.

jQuery
$( "#alert-btn" ).on( "click", function() {
  $( "#alert-box" )
    .hide()
    .fadeIn( 800 );
});
Try It Yourself

How It Works

.hide() runs immediately; .fadeIn(800) enqueues on fx. Chaining keeps reset-and-reveal logic in one readable line instead of separate show/hide calls.

Example 5 — fadeIn(600, "linear", callback) with Easing Since 1.4.3

Use the three-argument overload to pick linear easing instead of the default swing curve, with a completion callback.

jQuery
$( "#reveal" ).on( "click", function() {
  $( "#panel" ).fadeIn( 600, "linear", function() {
    $( this ).text( "Fade complete at constant speed" );
  });
});
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). jQuery UI adds more easing plugins.

🚀 Common Use Cases

  • Modal and overlay entrances — fade in dimmed backdrops and dialog panels after .hide() reset.
  • Progressive disclosure — reveal hidden divs one at a time on user interaction, as in the official demo.
  • Notification toasts — chain .hide().fadeIn() for repeatable alert-style messages.
  • Image galleries — cross-fade captions or thumbnails hidden with display: none.
  • Sequential storytelling — slow overlay fade followed by quick text reveal via the complete callback.
  • Effect chains — combine with .delay() and .fadeOut() for full show/hide choreography on the fx queue.

🧠 How .fadeIn() Reveals an Element

1

Element starts hidden

Target must be hidden — display: none from .hide() or CSS. Already-visible elements see little change.

Prerequisite
2

Display restored, opacity at 0

jQuery sets display so the box can render, then begins the opacity tween from transparent toward opaque.

Setup
3

Opacity animates over duration

Default 400 ms, or your chosen ms / fast / slow with optional swing or linear easing.

Tween
4

Full opacity and callback

Element ends at opacity 1 and visible. 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.
  • Similar to .fadeTo() but .fadeIn() unhides and always targets full opacity.
  • Callbacks fire once per matched element — use .promise().done() for one set-level callback.
  • Elements should be hidden first; calling on visible content produces minimal visible effect.
  • Set jQuery.fx.off = true globally to disable all effects including .fadeIn() (duration becomes 0).

Browser Support

.fadeIn() 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 .fadeIn()

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 fadeIn 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
.fadeIn() Universal

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

Conclusion

The .fadeIn() method is jQuery’s shorthand for revealing hidden elements with an opacity transition to full visibility. Three overloads cover simple durations, options objects, and easing since 1.4.3.

Hide elements first, pick your duration or preset, and use the complete callback to chain follow-up effects. Pair this method with .delay() behind you and .queue() ahead to master the full fx pipeline.

💡 Best Practices

✅ Do

  • Hide elements with .hide() or CSS before calling .fadeIn()
  • Use "slow" / "fast" for readable preset timing across your app
  • Chain .hide().fadeIn() to replay alert-style reveals on repeated clicks
  • Use the complete callback to enqueue the next effect without setTimeout
  • Call .promise().done() when you need one callback after all elements finish

❌ Don’t

  • Expect visible elements to animate — .fadeIn() is for hidden content
  • Use .fadeIn() when you need a partial opacity — choose .fadeTo() instead
  • Replace .fadeIn() with .animate({ opacity: 1 }) on hidden elements without handling display
  • 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 .fadeIn()

Shorthand reveal by fading hidden elements to full opacity.

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 hidden

display:none first

Rule

❓ Frequently Asked Questions

.fadeIn() displays matched elements by fading them to full opacity. It animates the opacity property from 0 toward 1 and restores appropriate display values so hidden content becomes visible. Use it when you want 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 specific opacity but does not unhide elements. .animate({ opacity: 1 }) tweens opacity but does not handle display the way shorthand effects do. .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.
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.
Yes. .fadeIn() is meant for elements that are hidden — typically display:none or visibility:hidden via .hide(). Calling it on already-visible elements has little visible effect because they are already opaque and shown.
Did you know?

The official jQuery .fadeIn() CENSORED demo runs a 3000 ms overlay fade, then fires a 100 ms span.fadeIn() inside the completion callback. That pattern — slow primary reveal, fast secondary reveal in the callback — is one of the most copied sequencing tricks in the entire effects API, and it needs no setTimeout at all.

Continue to .fadeOut()

Hide visible elements by fading to transparent, then set display:none.

.fadeOut() →

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