:animated (since jQuery 1.2) matches elements that are mid-animation right now — any node with a jQuery effects queue in progress. When the effect finishes, the element stops matching.
Remember
$(":animated") → every animating element
$("div:animated") → animating divs only
$("#panel div").filter(":animated") → faster pattern
$("#box").is(":animated") → true / false for one element
/* CSS transitions / WAAPI → not matched */
Start a jQuery effect, then query which elements are still running at that moment.
Ensure a full jQuery build with the effects module (not a slim custom build).
Start an effect such as .slideToggle(), .fadeIn(), or .animate().
Select candidates with CSS first: $("div") or $("#panel .box").
Narrow with .filter(":animated") (or use $("div:animated") for small demos).
Piece
Required?
Role
:animated
Yes
Matches elements with an active jQuery fx queue
Effects module
Yes
Without it, the selector throws
CSS base selector
Recommended
Lets native engines narrow the set first
Pseudocode
Pseudocode
candidates = find(cssSelector) // e.g. all divs
matches = empty list
for each element in candidates:
if element has active jQuery animation:
add element to matches
return jQuery(matches)
// snapshot at call time — not a live subscription
Reference
Cheat Sheet
Keep these facts handy while working with mid-animation queries.
Topic
Detail
Syntax
$(":animated") / $("div:animated")
Faster form
$("div").filter(":animated")
Single check
$("#el").is(":animated")
Timing
Snapshot when the selector runs
Counts as animated
jQuery fx only (.animate, slide, fade, …)
Does not count
CSS transitions / Web Animations API
Since
jQuery 1.2 (effects module required)
Try it
Live Preview
Start a looping slideToggle on #mover, then check which sample divs match :animated.
Sample DOM: one looping box (#mover) and one static box. Click Start, then Check while it slides.
mover
static
Result
Click Start, then Check while #mover is sliding.
$("div:animated")
matched: 0
ids: (none)
Code
jQuery Examples
Short, copy-ready snippets. Open a browser with jQuery loaded, or use Try It Yourself for a live editor.
Example 1 — Official Demo: List div:animated
While #mover loops with slideToggle, click to list which divs are mid-animation.
jQuery
$("#run").on("click", function () {
var ids = $("div:animated").map(function () {
return this.id || "(no id)";
}).get().join(", ");
console.log("animated:", ids || "(none)");
});
function animateIt() {
$("#mover").slideToggle("slow", animateIt);
}
animateIt();
#mover animated? true
#static animated? false
(while the slide is still running)
How It Works
Animate one box.slideToggle puts #mover into the fx queue.
Boolean check..is(":animated") returns true or false for that element.
Compare.#static stays false because nothing is running on it.
When to use. Guard logic like “do not start a new effect if one is already running.”
Example 3 — Faster Pattern: .filter(":animated")
Official performance tip: select with CSS first, then filter for animation state.
jQuery
$("#box-a, #box-b").slideToggle("slow");
$("#run").on("click", function () {
var n = $("#demo div").filter(":animated").length;
console.log("animating in #demo:", n);
});
animating: 2
(while both effects are still running)
How It Works
Start two effects. Fade and slide run on different elements at once.
Universal animated query.$(":animated") collects every mid-fx node.
Read length. The count equals how many effects are still in progress.
Demo tip. On large pages, prefer $("#area *").filter(":animated") instead.
Edge Cases & Pitfalls
Check these before relying on :animated in real projects.
module
Needs the effects module
A custom jQuery build without effects throws when :animated runs. Use a standard build that includes effects.
css
CSS motion is invisible to it
CSS transitions and the Web Animations API do not set jQuery’s fx flag. Only jQuery effects match.
timing
Snapshot, not a live stream
The selector reports state at call time. Between recursive slideToggle cycles the match set can briefly be empty.
perf
Bare $(":animated") is slower
Because it is a jQuery extension, prefer $("div").filter(":animated") so the first pass can use native CSS selection.
Compatibility
Browser Support
The :animated selector ships with jQuery 1.2+ and the standard effects module. It is a jQuery extension — not native CSS — so support follows your jQuery build, not a CSS feature table.
✓ jQuery 1.2+ · Effects module
jQuery :animated
Works in every browser that runs full jQuery with effects. No native querySelectorAll(':animated'). Slim custom builds without effects throw.
100%With full jQuery + effects
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
:animatedjQuery fx
Bottom line: Use a standard jQuery build that includes effects. For speed, select with CSS first, then .filter(":animated"). Do not expect CSS transitions to match.
Analysis
Performance Notes
Approach
Cost
Best for
$("div").filter(":animated")
CSS pass + filter
Recommended (official tip)
$("#el").is(":animated")
One element
Guards / single checks
$(":animated")
Full Sizzle scan
Small demos only
Official docs: because :animated is not CSS, it cannot use querySelectorAll. Narrow with a pure CSS selector first, then filter.
Remember
Key Takeaways
Role: match elements with an active jQuery animation queue.
Speed: use $("sel").filter(":animated"), not bare $(":animated").
Scope: jQuery fx only — not CSS transitions.
Build: requires the effects module or the selector throws.
One line::animated snapshots jQuery mid-effects — filter after a CSS selector for best results.
Frequently Asked Questions
:animated matches every element that is actively running a jQuery animation at the exact moment the selector executes. When the animation finishes, the element no longer matches until a new effect starts.
Any element with a jQuery effects queue in progress — .slideToggle(), .fadeIn(), .show('slow'), .animate(), and similar methods from the effects module. Pure CSS transitions or Web Animations API animations are not tracked by :animated.
jQuery tracks animation state internally when effects run. A custom slim build without the effects module has no animation registry, so :animated throws an error when used.
Because :animated is a jQuery extension, not standard CSS, it cannot use the browser's native querySelectorAll speed boost. Pick elements with a pure CSS selector first, then narrow with .filter(':animated').
Yes. Combine a tag with the pseudo: $("div:animated") matches only div elements that are animating. The official demo uses $("div:animated") on a click handler.
Only while the slide is running. In a recursive slideToggle loop, the element matches during each transition and stops matching briefly when the slide completes before the next toggle starts.