jQuery.fx.interval Property - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:jQuery.fx.interval

Description

The jQuery.fx.interval property sets the animation firing rate in milliseconds.

Syntax

ParameterRequire Description
milliseconds Required. animation firing rate in milliseconds. Default is 13 milliseconds

The following code shows how to Cause the animation of a <div> element to run with less frames:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("#toggle").on("click", function(){
        $("div").toggle(5000);
    });//www  . ja v a 2  s .c  o m
    $("#interval").on("click", function(){
        jQuery.fx.interval = 500;
    });
});
</script>
</head>
<body>


<button id="toggle">Toggle div</button>
<button id="interval">Run animation with less frames</button>

<div style="background:#98bf21;height:100px;width:100px;margin:50px;"></div>

</body>
</html>

Related Tutorials