jQuery.fx.off Property - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:jQuery.fx.off

Description

The jQuery.fx.off property globally disables/enables all animations.

Syntax

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

The following code shows how to Toggle animation on and off:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("#disable").click(function(){
        jQuery.fx.off = true;// w  w w .ja va2 s . co  m
    });
    $("#enable").click(function(){
        jQuery.fx.off = false;
    });
    $("#toggle").click(function(){
        $("div").toggle("slow");
    });
});
</script>
</head>
<body>

<button id="disable">jQuery.fx.off = true ( Disable )</button>
<button id="enable">jQuery.fx.off = false ( Enable )</button>
<br><br>
<button id="toggle">Toggle animation</button>

<div style="background:#98bf21;height:100px;width:100px;margin:50px;"></div>

</body>
</html>

Related Tutorials