
- jQuery - Home
- jQuery - Roadmap
- jQuery - Overview
- jQuery - Basics
- jQuery - Syntax
- jQuery - Selectors
- jQuery - Events
- jQuery - Attributes
- jQuery - AJAX
- jQuery CSS Manipulation
- jQuery - CSS Classes
- jQuery - Dimensions
- jQuery - CSS Properties
- jQuery Traversing
- jQuery - Traversing
- jQuery - Traversing Ancestors
- jQuery - Traversing Descendants
- jQuery References
- jQuery - Selectors
- jQuery - Events
- jQuery - Effects
- jQuery - HTML/CSS
- jQuery - Traversing
- jQuery - Miscellaneous
- jQuery - Properties
- jQuery - Utilities
- jQuery Plugins
- jQuery - Plugins
- jQuery - PagePiling.js
- jQuery - Flickerplate.js
- jQuery - Multiscroll.js
- jQuery - Slidebar.js
- jQuery - Rowgrid.js
- jQuery - Alertify.js
- jQuery - Progressbar.js
- jQuery - Slideshow.js
- jQuery - Drawsvg.js
- jQuery - Tagsort.js
- jQuery - LogosDistort.js
- jQuery - Filer.js
- jQuery - Whatsnearby.js
- jQuery - Checkout.js
- jQuery - Blockrain.js
- jQuery - Producttour.js
- jQuery - Megadropdown.js
- jQuery - Weather.js
jQuery jQuery.fx.off Property
The jQuery.fx.off property in jQuery is used to globally disable or enable all jQuery animations. It is a boolean property. The default value is false, which means animations are enabled by default.
Setting this property to true will disable all animations, making them complete immediately.
Syntax
Following is the syntax of jQuery jQuery.fx.off Property −
jQuery.fx.off = true|false;
Parameters
Here is the description of the above syntax −
- true: Disables all jQuery animations.
- false: Enables all jQuery animations.
Example
This example demonstrates toggling animations on and off using "jQuery's jQuery.fx.off property" −
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("#disable").click(function(){ jQuery.fx.off = true; $("#animationStatus").text("Animations: Disabled"); }); $("#enable").click(function(){ jQuery.fx.off = false; $("#animationStatus").text("Animations: Enabled"); }); $("#toggle").click(function(){ $("div").toggle("slow"); }); }); </script> </head> <body> <button id="disable">Animations: Disable (jQuery.fx.off = true)</button> <button id="enable">Animations: Enabled (jQuery.fx.off = false)</button> <br><br> <button id="toggle">Toggle animation</button> <p id="animationStatus">Animations: Enabled</p> <div style="background:#98bf21;height:100px;width:100px;margin:50px;"></div> </body> </html>
The 'Toggle animation' button toggles the visibility of a div with a slow animation effect. Clicking 'Disable' turns off animations globally, while clicking 'Enable' restores animations.
jquery_ref_properties.htm
Advertisements