.delay() (since jQuery 1.4) sets a timer that pauses subsequent items on a queue (default "fx"). It does not animate by itself — it waits, then the next queued step runs. Returns the jQuery object for chaining.
Remember
$("#foo").slideUp(300).delay(800).fadeIn(400);
$el.delay("slow"); // 600 ms
$el.delay(500, "tasks"); // named queue
// Only queued steps wait · not instant show/hide/css
Chain .delay() between two queued effects so the second waits after the first finishes.
Select the element ($("#foo")).
Start a queued effect (.slideUp(300)).
Call .delay(800) (or "fast" / "slow").
Chain the next queued effect (.fadeIn(400)).
To cancel before it fires, call .clearQueue() (and .stop() if needed).
Piece
Required?
Role
duration
Yes
Milliseconds, or "fast" (200) / "slow" (600)
queueName
No
Defaults to "fx"; pass a custom name when needed
Return value
—
jQuery object (chainable)
Pseudocode
Pseudocode
call $(elements).delay(duration, queueName?)
name = queueName or "fx"
ms = resolve duration ("fast"→200, "slow"→600, or number)
for each matched element:
enqueue a timer step on queue "name"
when prior queued work is done:
wait ms milliseconds
then run the next queued function
return the jQuery set for chaining
Reference
Cheat Sheet
Keep these facts handy while timing effect chains.
Topic
Detail
Syntax
.delay( duration [, queueName ] )
Since
jQuery 1.4
Default queue
"fx"
Presets
"fast" = 200 · "slow" = 600
Classic chain
.slideUp(300).delay(800).fadeIn(400)
Does not delay
Instant .show() / .hide() / .css()
Cancel pending
$el.clearQueue()
Named queue
$el.delay(500, "tasks")
vs setTimeout
Queue-aware pause · limited cancel API
Try it
Live Preview
Run a slideUp → delay → fadeIn chain. Pick the pause length, then reset.
Watch the pause between slide up and fade in.
The box slides up, waits, then fades back in. Reset restores a visible starting state.
Result
Ready — click Run to delay between effects.
Code
jQuery Examples
Short, copy-ready snippets. Open DevTools, or use Try It Yourself for a live editor.
Example 1 — Official Two-Div Demo
From the jQuery docs: first div delays 800 ms; second fades in immediately after slideUp.
jQuery
$("button").on("click", function () {
$("div.first").slideUp(300).delay(800).fadeIn(400);
$("div.second").slideUp(300).fadeIn(400);
});
Start → slideUp, then 2s delay queued
Stop mid-delay → pending delay + fadeIn removed
fadeIn never runs
How It Works
Start. Chains slideUp, a 2s delay, then fadeIn.
Waiting. During the delay, fadeIn is still pending on fx.
clearQueue. Removes the delay timer and fadeIn.
stop. Halts any effect currently playing.
Watch outs
Edge Cases & Pitfalls
Case
What happens
Fix
Delay before instant .show()
show runs immediately
Use a queued effect, or setTimeout
Need cancel mid-wait
.delay() has no dedicated cancel API
.clearQueue(), or use clearTimeout
Wrong queue name
Pause never applies to your steps
Match the name used in .queue("name", …)
Spam-click chains
Many delays stack on fx
.clearQueue().stop() before starting again
Long delays for UX
Feels sluggish
Keep pauses short; prefer subtle timing
Compatibility
Browser Support
.delay() has been part of jQuery since 1.4. It works in every browser that runs your loaded jQuery version — no separate timer feature flag.
✓ Stable · jQuery 1.4+
jQuery .delay()
Supported across jQuery 1.x (1.4+), 2.x, and 3.x. Prefer a current jQuery 3.x build. Use it for fx pauses; use setTimeout for general timers.
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
.delay()Universal
Bottom line: Safe between queued effects. Remember it does not delay instant methods, and clearQueue can cancel a pending pause.
Analysis
Performance Notes
Approach
Cost
Best for
One .delay() in a chain
Cheap
Short pauses between effects
Many stacked delays
Wasted waiting
Clear the queue on busy buttons
Staggered list (i * n)
Fine for small sets
Keep item counts modest
A single delay is inexpensive. Cost comes from stacking long chains on rapid clicks — clear pending work before restarting, and keep pauses short for better UX.
Remember
Key Takeaways
Role: pause subsequent queued steps — since jQuery 1.4.
Call:$el.slideUp().delay(800).fadeIn() — ms or fast/slow.
Scope: queue only — not instant show/hide/css.
Cancel:.clearQueue() · prefer setTimeout for general timers.
One line:.delay() inserts a timed pause between queued effects — not a general-purpose timer.
Frequently Asked Questions
.delay() inserts a timed pause into a jQuery queue on matched elements. It does not animate anything itself — it waits for the specified duration, then lets the next queued function run. Use it between chained effects like .slideUp().delay(800).fadeIn().
.delay(duration [, queueName]) takes duration as milliseconds or the strings "fast" (200 ms) and "slow" (600 ms). The optional queueName (default "fx") targets a named custom queue instead of the standard effects queue.
No. .delay() only affects subsequent items already enqueued on a jQuery queue. Instant no-argument .show() / .hide() and .css() run immediately and are not delayed.
.delay() is queue-aware — the next queued step runs after prior effects finish plus the delay. setTimeout fires on the browser timer independently and can overlap animations unless you coordinate manually. Prefer setTimeout when you need flexible cancel or non-queue logic.
Yes. jQuery maps "fast" to 200 ms and "slow" to 600 ms, the same as .animate() and .fadeIn(). Example: .delay("slow") pauses the queue for 600 ms.
Yes. .delay() enqueues a timer step. Calling .clearQueue() (or .stop(true)) removes pending queued items, including an unfinished delay, so the next effect will not run unless you start the chain again.