Q:

Toggle animation on and off using jquery

0

Toggle animation on and off using jquery

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

HTML Code:

<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
  <meta charset="utf-8">
  <title>Toggle animation on and off</title>
</head>
<body>
<button id="enable">(Enable) jQuery.fx.off = false)</button>  
<button id="disable">(Disable) jQuery.fx.off = true)</button>
<br><br>
<button id="toggle">Toggle animation</button>
<div style="background:#98bf21;height:100px;width:100px;margin:50px;"></div>  
</body>
</html>

JavaScript Code :

$("#enable").click(function(){
        jQuery.fx.off = false;
    }); 

$("#disable").click(function(){
        jQuery.fx.off = true;
    });
 
 $("#toggle").click(function(){
        $("div").toggle("slow");
    });

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now