jQuery jQuery.fx.off Property

Beginner
⏱️ 8 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Global Config

What You’ll Learn

The jQuery.fx.off static property is a global on/off switch for every jQuery animation on the page. This tutorial covers how setting it to true makes effects jump to their final state instantly, reading the Boolean value, re-enabling with false, use cases for low-resource devices and accessibility or reduced motion, comparisons with jQuery.fx.interval, prefers-reduced-motion, and per-call duration: 0, and five hands-on examples from the official toggle demo to re-enabling smooth motion.

01

Global off

Disable all effects

02

Since 1.3

Stable static property

03

Boolean

Read true or false

04

Instant end

Skip tween frames

05

Re-enable

Set false to restore

06

A11y & perf

Reduced motion, low CPU

Introduction

When you call .animate(), .fadeIn(), or .slideToggle(), jQuery normally runs a tween that updates CSS over time. The global jQuery.fx.off property overrides that behavior for every effect on the page: when it is true, animation methods still execute their logic and callbacks, but durations become zero and elements snap to their end states immediately.

Added in jQuery 1.3, fx.off is the practical sibling to low-level timer tuning with jQuery.fx.interval. Where fx.interval adjusted how often ticks fired on legacy browsers, fx.off removes motion entirely. The official jQuery documentation recommends it for low-resource devices and for users who experience accessibility problems with animated UI. You can flip it at runtime — the canonical demo toggles $.fx.off with a button while a slow .toggle() on green boxes shows the difference.

Understanding the jQuery.fx.off Property

Per the official jQuery API, jQuery.fx.off globally disables all animations. It is a static property on the global jQuery.fx object — not a method you call on a jQuery collection like $(selector).fadeOut().

Read it to inspect whether effects are disabled; assign true or false to change global behavior. Because it applies page-wide, one assignment affects every subsequent effect method until you change it again. Callbacks, promises, and queue progression still run — only the visible tween is skipped.

💡
Beginner Tip

Think of jQuery.fx.off as a master mute button for jQuery motion. When muted (true), a .fadeIn( "slow" ) still fires its complete callback, but the element appears at full opacity instantly. When unmuted (false), durations and easing work normally again.

📝 Syntax

One global Boolean property on jQuery.fx:

jQuery
// Read whether animations are disabled - since jQuery 1.3
jQuery.fx.off
// Globally disable all jQuery effects (instant end states)
jQuery.fx.off = true
// Re-enable normal animation durations
jQuery.fx.off = false

Type and behavior

  • Type: Booleantrue disables all effects; false enables them.
  • Default: false — animations run with their configured durations.
  • Scope: Global — one value shared by every jQuery animation on the page.

Version notes

  • Added: jQuery 1.3
  • Status: Stable — still documented and supported in current jQuery releases.
  • Returns: Boolean when read — inspect before toggling in conditional logic.

Official jQuery API demo pattern

jQuery
var toggleFx = function() {
  $.fx.off = !$.fx.off;
};
toggleFx();
$( "button" ).on( "click", toggleFx );
$( "input" ).on( "click", function() {
  $( "div" ).toggle( "slow" );
} );

⚡ Quick Reference

GoalCode
Read current statejQuery.fx.offtrue or false
Disable all effects globallyjQuery.fx.off = true
Re-enable animationsjQuery.fx.off = false
Toggle on button click$.fx.off = !$.fx.off
Respect reduced motion (CSS)@media (prefers-reduced-motion: reduce)
Skip one animation only.animate( props, 0 ) or .finish()

📋 jQuery.fx.off vs jQuery.fx.interval vs prefers-reduced-motion vs duration 0

Four ways to control motion — only fx.off globally disables every jQuery effect with a single Boolean switch.

jQuery.fx.off
jQuery.fx.off = true

Global Boolean off switch since 1.3. All effect methods snap to end states instantly. Set false to restore smooth motion page-wide.

jQuery.fx.interval
jQuery.fx.interval = 50

Adjusts legacy timer tick rate, not on/off. Deprecated 3.0, removed 4.0. Animations still run — they may just look choppier on timer fallback browsers.

prefers-reduced-motion
@media (prefers-reduced-motion: reduce)

OS-level user preference via CSS media query. Standards-based accessibility; pair with fx.off = true in JS when the query matches.

duration 0
.animate({ left: 300 }, 0)

Per-call instant tween for one element and one method. Does not affect other animations or global defaults like fx.off does.

Examples Gallery

Each example demonstrates a core jQuery.fx.off concept from the official toggle demo to re-enabling smooth motion. Open DevTools or use the Try-it links. Example 1 mirrors the demo on api.jquery.com/jQuery.fx.off/.

📚 Getting Started

Toggle jQuery.fx.off at runtime and read the Boolean state before and after each flip.

Example 1 — Official Demo: Toggle fx Button and Slow .toggle() on Click

Mirror the official jQuery demo: a “Toggle fx” button flips $.fx.off, and clicking an input runs $( "div" ).toggle( "slow" ) on green boxes. With fx.off true, boxes snap visible or hidden instantly; with false, the slow toggle animates.

jQuery
var toggleFx = function() {
  $.fx.off = !$.fx.off;
  $( "#fx-status" ).text(
    "jQuery.fx.off = " + $.fx.off
  );
};
toggleFx();
$( "#toggle-fx" ).on( "click", toggleFx );
$( "#run-toggle" ).on( "click", function() {
  $( ".fx-box" ).toggle( "slow" );
} );
Try It Yourself

How It Works

The toggle function negates the current Boolean. Calling it once on load sets an initial state and updates the status label. Effect methods honor fx.off at call time — no need to stop running animations first because disabled effects never start a tween.

Example 2 — Read State: Log jQuery.fx.off Before and After Toggle

Inspect the property directly. Reading jQuery.fx.off always returns a Boolean reflecting whether global effects are disabled.

jQuery
console.log( "Before:", jQuery.fx.off, typeof jQuery.fx.off );
jQuery.fx.off = !jQuery.fx.off;
console.log( "After toggle:", jQuery.fx.off );
$( "#log-state" ).on( "click", function() {
  var before = jQuery.fx.off;
  jQuery.fx.off = !before;
  $( "#state-output" ).html(
    "Before: " + before + " → After: " + jQuery.fx.off
  );
} );
Try It Yourself

How It Works

Unlike numeric properties such as fx.interval, fx.off is strictly Boolean. Use it in conditionals — for example, only set true when window.matchMedia( "(prefers-reduced-motion: reduce)" ).matches and the value is not already disabled.

📈 Advanced Patterns

Instant end states versus animated tweens, accessibility simulation, and restoring smooth motion.

Example 3 — fx.off true: fadeIn and animate Snap to Final State vs Animated When false

Set jQuery.fx.off = true and run .fadeIn() and .animate() — elements jump to end values instantly. Set false and repeat to see smooth motion.

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

How It Works

jQuery checks fx.off when an effect starts. If true, internal duration is treated as zero while queue semantics and complete callbacks still fire. This differs from passing 0 as duration on a single call — fx.off applies to every effect method globally.

Example 4 — Accessibility: Simulate Reduced Motion by Setting fx.off true on Load

On page load, detect prefers-reduced-motion: reduce (or a test checkbox) and set jQuery.fx.off = true so users who prefer less motion never see jQuery tweens.

jQuery
var reducedMotion = window.matchMedia(
  "(prefers-reduced-motion: reduce)"
).matches;
if ( reducedMotion ) {
  jQuery.fx.off = true;
  $( "#a11y-note" ).text(
    "Reduced motion detected — jQuery.fx.off = true"
  );
}
$( "#simulate-reduced" ).on( "click", function() {
  jQuery.fx.off = true;
  $( "#a11y-note" ).text(
    "Simulated reduced motion — effects disabled globally"
  );
} );
$( "#panel-toggle" ).on( "click", function() {
  $( "#a11y-panel" ).slideToggle( "slow" );
} );
Try It Yourself

How It Works

The official docs cite accessibility as a primary use case. CSS prefers-reduced-motion is the standards-based signal; mapping it to fx.off disables jQuery-driven motion while leaving non-jQuery CSS transitions for you to handle separately in stylesheets.

Example 5 — Re-enable: Set jQuery.fx.off = false and Run Smooth Animation Again

After disabling effects for testing or low-resource mode, restore motion by assigning false, then run a visible .animate() to confirm tweens work again.

jQuery
jQuery.fx.off = true;
$( "#disable-all" ).on( "click", function() {
  jQuery.fx.off = true;
  $( "#restore-status" ).text( "Animations OFF" );
} );
$( "#enable-all" ).on( "click", function() {
  jQuery.fx.off = false;
  $( "#restore-status" ).text( "Animations ON" );
  $( "#restore-box" )
    .stop( true, true )
    .css({ left: 0, opacity: 0.3 })
    .animate({ left: 260, opacity: 1 }, 1200 );
} );
Try It Yourself

How It Works

Re-enabling is a single assignment. The next effect call after false uses normal durations. Call .stop( true, true ) before starting a fresh demo animation so no stale queue entries interfere with the visual comparison.

🚀 Common Use Cases

  • Low-resource devices — set jQuery.fx.off = true on older phones or embedded browsers where animation timers drain CPU and battery.
  • Accessibility and reduced motion — honor prefers-reduced-motion: reduce by disabling jQuery effects globally for users sensitive to motion.
  • Automated testing — skip animated waits in unit or integration tests by turning effects off so callbacks fire immediately.
  • Debugging effect chains — isolate queue and callback logic without waiting for tweens to finish visually.
  • Progressive enhancement toggle — expose a user setting that flips fx.off like the official demo’s Toggle fx button.
  • Performance profiling — compare page behavior with and without jQuery motion to measure layout or script cost.

🧠 How jQuery.fx.off Skips Animation Ticks

1

Effect method called

Code invokes .animate(), .fadeIn(), or similar. jQuery enqueues the effect on the fx pipeline and checks the global jQuery.fx.off flag.

Trigger
2

fx.off is true

When the property is true, jQuery treats duration as zero. No timer or requestAnimationFrame loop runs; the tween completes in the same turn.

Skip
3

Final state applied

CSS end values are written immediately — opacity 1, target left, hidden display, etc. The element looks as if the animation finished.

Apply
4

Callbacks and queue advance

complete handlers and deferred promises still resolve. The next queued function runs. Set fx.off = false before the next call to restore visible tweens.

📝 Notes

  • Added in jQuery 1.3 as a global Boolean property on jQuery.fx, not an instance method.
  • Default value is false — animations run normally until you set true.
  • Reading the property returns true or false — use it in conditionals before toggling.
  • When true, all effect methods jump to final states instantly; durations and speed names like "slow" are ignored.
  • Set jQuery.fx.off = false to re-enable smooth motion for every subsequent effect.
  • One global flag for the entire page — not per-element, per-queue, or per-method.
  • Does not disable CSS transitions or non-jQuery animation libraries — only jQuery’s fx engine.

Browser Support

jQuery.fx.off has been available since jQuery 1.3 and remains supported in current jQuery 3.x releases. It is a JavaScript-level global switch independent of browser animation APIs.

Stable · Since jQuery 1.3

jQuery.fx.off

Works in every browser that runs jQuery. Setting true skips tweens regardless of requestAnimationFrame support. Pair with prefers-reduced-motion for accessible defaults.

Universal All jQuery browsers
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
fx.off Stable

Bottom line: Use fx.off for global jQuery motion control. Learn .queue() next to inspect the fx pipeline these effects use when animations are enabled.

Conclusion

jQuery.fx.off is a global static Boolean property that disables all jQuery animations when set to true. Effects still run their queue logic and callbacks, but elements snap to end states instantly. Assign false to restore normal durations.

Reach for fx.off on low-resource devices, for accessibility and reduced motion preferences, or in tests that should not wait on tweens. Prefer prefers-reduced-motion as the user signal, and use per-call duration: 0 when only one animation should skip. Continue to .queue() to inspect the fx pipeline these effects use when motion is enabled.

💡 Best Practices

✅ Do

  • Read jQuery.fx.off before toggling to avoid redundant assignments
  • Pair with prefers-reduced-motion for standards-based accessibility
  • Use fx.off = true in tests to skip animated delays
  • Restore false after temporary disable so users get motion when appropriate
  • Document global toggles in app settings UI like the official demo

❌ Don’t

  • Confuse fx.off with fx.interval — off skips motion entirely
  • Expect fx.off to disable CSS transitions in stylesheets
  • Leave true permanently without user consent or reduced-motion match
  • Use fx.off when a single call needs instant behavior — pass duration: 0 instead
  • Assume toggling mid-tween cancels in-flight CSS — it affects the next effect start

Key Takeaways

Knowledge Unlocked

Five things to remember about jQuery.fx.off

Global Boolean switch for all jQuery effects.

5
Core concepts
02

Since 1.3

Stable property

API
🔄 03

Boolean read

true or false

Type
📝 04

Instant end

Skip tween frames

Behavior
05

false restores

Smooth again

Re-enable

❓ Frequently Asked Questions

When set to <code>true</code>, <code>jQuery.fx.off</code> globally disables all jQuery animations. Every effect method &mdash; <code>.animate()</code>, <code>.fadeIn()</code>, <code>.slideToggle()</code>, and similar &mdash; skips the tween and applies the end state immediately. It is a static property on the global <code>jQuery.fx</code> object, not an instance method on a jQuery collection.
The property was added in jQuery 1.3. It has remained a stable global switch for turning jQuery effects on or off across the entire page, unlike <code>jQuery.fx.interval</code> which was deprecated in 3.0 and removed in 4.0.
Reading <code>jQuery.fx.off</code> returns a <code>Boolean</code>. <code>true</code> means all jQuery animations are disabled globally; <code>false</code> means effects run normally with their configured durations and easing.
Effects jump to their final state instantly. A <code>.fadeIn( &quot;slow&quot; )</code> call still runs its callbacks and queue logic, but the element appears at full opacity immediately instead of tweening over 600 ms. No intermediate frames are painted.
Assign <code>jQuery.fx.off = false</code> (or <code>$.fx.off = false</code>). Every subsequent effect method uses normal durations again. You can toggle the property at runtime &mdash; the official demo on api.jquery.com flips it with a button click.
Two common scenarios from the official docs: jQuery running on low-resource devices where animation timers cost CPU, and users who encounter accessibility problems with motion. Pair it with <code>prefers-reduced-motion</code> media queries for a standards-based approach, or use it in tests to skip animated waits.
Did you know?

The official jQuery demo for jQuery.fx.off calls toggleFx() once on page load before wiring the button — that initial call flips the default false to true, so the first click on the input demonstrates instant toggles until you press “Toggle fx” again. The property has been documented since jQuery 1.3 alongside the growing effects API. See the live pattern at api.jquery.com/jQuery.fx.off/.

Continue to jQuery.speed()

Learn how jQuery normalizes duration, easing, and callbacks into a PlainObject for plugin authors.

jQuery.speed() →

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