jQuery.fx.off


 

jQuery.fx.off

In this tutorial, we will discuss about "jQuery.fx.off" property.

In this tutorial, we will discuss about "jQuery.fx.off" property.

jQuery.fx.off

In this tutorial, we will discuss about "jQuery.fx.off" property. When this property is set to true, all animation methods will immediately set elements to their final state when called, rather than displaying an effect.

jQueryfx.html

<!DOCTYPE html>
<html>
<head>
<style>
div { width:150px; height:130px; margin:15px; float:left;
background:purple; }
</style>
<script src="jquery-1.4.2.js"></script>
</head>
<body>
<p><input type="button" value="Run"/> <button>Toggle fx</button></p>
<div></div>
<script>
var toggleFx = function() {
$.fx.off = !$.fx.off;
};
toggleFx();

$("button").click(toggleFx)

$("input").click(function(){
$("div").toggle("slow");
});
</script>
</body>
</html>

OUTPUT

Description of the program

When application starts, and if you click on "run" , it will hide slowly showing you a animation effect. But when you click on "Togglefx" button ,it will only show/hide on clicking "Run " without showing you any animation effect .

Download Source Code 

Click here to see demo

Ads