jQuery jQuery.fx.offProperty

jQuery 属性jQuery Properties

Examples

Toggle animation switch:

$("#disable").click(function(){
    jQuery.fx.off = true;
});
$("#enable").click(function(){
    jQuery.fx.off = false;
});
$("#toggle").click(function(){
    $("div").toggle("slow");
});

Try it Yourself »

Definition and Usage

The jQuery.fx.off property is used to globally disable or enable all animations.

The default value is false, which allows animations to run normally. When set to true, all animation methods will be disabled, which will set elements to their final state instead of showing effects.

Tip:To simplify the code, you can use $.fx.off instead of jQuery.fx.off.


Syntax

jQuery.fx.off = true|false;

Parameter Description
true Specifies that animations should be disabled.
false Default. Specifies that animations should be enabled.


jQuery 属性jQuery Properties

Other Extensions