jQuery jQuery.fx.off Property

Beginner
5 min read
Updated: Nov 2026
3 examples
Effects

Definition

jQuery.fx.off (since jQuery 1.3) is a global Boolean that turns every jQuery animation on or off. When true, effect methods jump to the final state immediately. When false (default), durations and easing run normally.

Syntax

Start with these common calls. Keep them short and readable.

jQuery
jQuery.fx.off          // read → true or false
jQuery.fx.off = true;  // disable all effects (instant end)
jQuery.fx.off = false; // re-enable normal durations

// $.fx.off is the same property
// Callbacks still run — only the tween is skipped
CallWhat it does
jQuery.fx.offLearn jQuery.fx.off: globally disable all jQuery animations when true (since 1.3), snap effects to their final state, re-enable with false, and use it for low-resource devices and reduced-motion accessibility.

Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.

Parameters

ParameterDescription
Step 1Optionally read jQuery.fx.off to see the current state.
Step 2Set true to disable (or false to enable).
Step 3Call .fadeIn(), .animate(), .toggle("slow"), etc.

Return Value

Return ValueDescription
BooleanOften true or false depending on the match or state.

jQuery Examples

Example 1 — Official Toggle Demo

Flip $.fx.off, then run .toggle("slow") — snap vs animate.

jQuery
var toggleFx = function () {
  $.fx.off = !$.fx.off;
  $("#status").text("jQuery.fx.off = " + $.fx.off);
};

toggleFx();
$("#toggle-fx").on("click", toggleFx);
$("#run").on("click", function () {
  $(".box").toggle("slow");
});
Try It Yourself

How It Works

  1. Flip. !$.fx.off toggles the global Boolean.
  2. Show state. Update a label so you can see the current value.
  3. Effect. .toggle("slow") checks fx.off when it starts.

Example 2 — Read the Boolean State

Inspect type and value before and after a toggle.

jQuery
$("#log").on("click", function () {
  var before = jQuery.fx.off;
  jQuery.fx.off = !before;
  $("#out").text(
    "Before: " + before + " (" + typeof before + ")\n" +
    "After: " + jQuery.fx.off
  );
});
Try It Yourself

How It Works

  1. Read. Access the static property — no method call.
  2. Type. Always a Boolean (unlike fx.interval’s Number).
  3. Toggle. Assign the negated value.

Example 3 — Instant vs Animated

Same fadeIn / animate calls — behavior depends only on fx.off.

jQuery
$("#run-off").on("click", function () {
  jQuery.fx.off = true;
  $("#fade").hide().fadeIn(800);
  $("#move").css({ marginLeft: 0 }).animate({ marginLeft: 160 }, 800);
  $("#mode").text("fx.off = true — instant end states");
});

$("#run-on").on("click", function () {
  jQuery.fx.off = false;
  $("#fade").hide().fadeIn(800);
  $("#move").css({ marginLeft: 0 }).animate({ marginLeft: 160 }, 800);
  $("#mode").text("fx.off = false — smooth 800 ms tweens");
});
Try It Yourself

How It Works

  1. Set flag. Assign before starting effects.
  2. Same API. Call signatures stay unchanged.
  3. Off path. Duration is treated as zero; end CSS applies now.

Frequently Asked Questions

When set to true, jQuery.fx.off globally disables all jQuery animations. Effect methods such as .animate(), .fadeIn(), and .slideToggle() jump elements to their final state immediately instead of tweening. It is a static Boolean on jQuery.fx — not a method on a collection.
It was added in jQuery 1.3 and remains a stable global switch in current releases — unlike jQuery.fx.interval, which was deprecated in 3.0 and removed in 4.0.
A Boolean. true means all jQuery effects are disabled globally; false (the default) means durations and easing run normally.
Yes. Queue progression and complete callbacks still fire. Only the visible tween is skipped — the end CSS is applied in one step.
Assign jQuery.fx.off = false (or $.fx.off = false). Every subsequent effect uses normal durations again. You can toggle it at runtime.
Official use cases: low-resource devices where animation timers cost CPU, and users with accessibility / motion sensitivity. Pair with prefers-reduced-motion, or use it in tests to skip animated waits.

Next: jQuery.speed() Method

Normalize duration, easing, and complete into a standard options object for effects.

jQuery.speed() Method tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

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