DO YOU NEED A CONTENT WRITER FOR YOUR BUSINESS?

Your One-Stop Solution for All Content Needs! Click here for more!
Categories: jQuery

How to disable jQuery animations

Share

The jQuery.fx.off method is used to globally enable or disable jQuery animations whose default value is false which allows animations to run normally.

Syntax:

jQuery.fx.off = true|false;
$.fx.off = true|false;

The true value specifies that the animations should be disabled and the false value is default value which specifies that the animations should be enabled.

Read Also: jQuery jQuery scroll to element

Example to enable or disable jQuery animations:

<button id="disable">Disable</button>
<button id="enable">Enable</button>
<button id="toggle">Toggle animation</button>
<div style="background:#C2C2C2;height:100px;width:100px;"></div>
<script>
$(document).ready(function(){
$("#disable").click(function(){
jQuery.fx.off = true;
});
$("#enable").click(function(){
jQuery.fx.off = false;
});
$("#toggle").click(function(){
$("div").toggle("slow");
});
});
</script>

In this way you can enable/disable the animations by setting the property to true or false.

Go to jQuery reference for more information.

Jacob Frazier

Based on United States, Jacob Frazier is a skilled JavaScript developer with over 8 years of experience. He is passionate about change and trying new things, both professionally and personally. He loves startups and is extremely proactive.

Recent Posts

How Small Brands Can Make Offline Touchpoints Feel More Memorable

Most small brands spend a lot of energy improving digital touchpoints. They refine their websites,…

6 hours ago

What Should You Do When a Dog Bites You?

Not every dog is friendly, and even friendly dogs can attack when threatened or provoked.…

9 hours ago

Holding Manufacturers Accountable: Steps to File a Lawsuit for Pressure Cooker Explosions

Pressure cookers have become a favored kitchen appliance because they can quickly and efficiently cook…

1 day ago

Reasons to Hire a Shopify Web Designer for Your Business

Shopify has quickly become the preferred platform for businesses seeking to build an online presence.…

4 days ago

How To Gain Free Instagram Followers and Likes Easily-GetInsta

We all know that Instagram is a very famous social platform that attracts more and…

1 week ago

How to tell whether high-level glass is toughened or laminated

Glass at height is easy to overlook, in both senses. It is out of reach,…

2 weeks ago