: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.
Syntax
Start with these common calls. Keep them short and readable.
jQuery
$(":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 */
Call
What it does
:animated
Matches elements with an active jQuery fx queue
Effects module
Without it, the selector throws
CSS base selector
Lets native engines narrow the set first
Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.
Parameters
Parameter
Description
Step 1
Ensure a full jQuery build with the effects module (not a slim custom build).
Step 2
Start an effect such as .slideToggle(), .fadeIn(), or .animate().
Step 3
Select candidates with CSS first: $("div") or $("#panel .box").
Return Value
Return Value
Description
See examples
Check the examples below for what this API returns in common cases.
jQuery Examples
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.
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 in #demo: 2
(while both slides are still running)
How It Works
CSS first.$("#demo div") can use native selector speed.
Then filter..filter(":animated") keeps only nodes with an active fx queue.
Why it helps. Bare $(":animated") cannot use querySelectorAll.
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.