उदाहरण
jQuery का उपयोग करके एनिमेशन को ग्लोबली डिसेबल करने के लिए, jQuery.fx.off प्रॉपर्टी का उपयोग करें।
एनिमेशन सक्षम करने के लिए:
$("#enable").click(function(){
jQuery.fx.off = false;
});
एनिमेशन अक्षम करने के लिए, jQuery.fx.off को true सेट करें:
$("#disable").click(function(){
jQuery.fx.off = true;
});
jQuery का उपयोग करके एनिमेशन को ग्लोबली डिसेबल करने के लिए निम्न कोड आज़माएं:
<html>
<head>
<title>jQuery उदाहरण</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("#enable").click(function(){
jQuery.fx.off = false;
});
$("#disable").click(function(){
jQuery.fx.off = true;
});
$("#go").click(function(){
$(".target").animate({left: '+=200px'}, 2000);
});
$("#back").click(function(){
$(".target").animate({left: '-=200px'}, 200);
});
});
</script>
<style>
p {background-color:#bca; width:350px; border:1px solid green;}
div{position: absolute; left: 50px; top:300px;}
</style>
</head>
<body>
<p>सक्षम या अक्षम पर क्लिक करें और फिर गो या बैक बटन:</p>
<button id="enable"> सक्षम </button>
<button id="disable"> अक्षम </button>
<button id="go"> GO </button>
<button id="back"> BACK </button>
<div class="target">
<img src="./images/jquery.jpg" alt="jQuery" />
</div>
</body>
</html>