Home Tutorial Jquery jQuery.fx.off

 
 

jQuery.fx.off
Posted on: August 4, 2010 at 12:00 AM
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

Related Tags for jQuery.fx.off:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.