jQuery | jQuery.fx.interval Property with example
The jQuery.fx.interval property in jQuery is used to modify the number of frames per second at which animations will run and to change the animation firing rate in milliseconds. Its default value is 13ms.
Syntax:
jQuery.fx.interval = milliseconds;
Parameters: This method accepts single parameter milliseconds which is mandatory. It is used to specify the animation firing rate in milliseconds. It default value is 13 milliseconds.
Example 1: This example uses jQuery.fx.interval property to change the animation firing rate.
<!DOCTYPE html> < html > < head > < title > jQuery jQuery.fx.interval Property </ title > < script src = </ script > < style > .box { background:green; height:100px; width:100px; margin:50px; } </ style > </ head > < body > < center > < h1 style = "color:green;" > GeeksForGeeks </ h1 > < h2 > jQuery.fx.interval property</ h2 > < button id = "toggle" > Toggle div </ button > < button id = "interval" > Run animation with less frames </ button > < div class = "box" ></ div > <!-- Script to illustrate jQuery.fx.interval property --> < script > $(document).ready(function(){ $("#toggle").on("click", function() { $("div").toggle(5000); }); $("#interval").on("click", function() { jQuery.fx.interval = 500; }); }); </ script > </ center > </ body > </ html > |
Output
Example 2: This example uses jQuery.fx.interval property to change the animation firing rate.
<!DOCTYPE html> < html > < head > < title > jQuery jQuery.fx.interval Property </ title > < script src = </ script > < style > .box { background:green; height:100px; width:100px; margin:50px; } </ style > </ head > < body > < center > < h1 style = "color:green;" > GeeksForGeeks </ h1 > < h2 > jQuery.fx.interval property</ h2 > < button id = "toggle" > Toggle div </ button > < button id = "interval" > Run animation with less frames </ button > < div class = "box" ></ div > <!-- Script to illustrate jQuery.fx.interval property --> < script > $(document).ready(function(){ $("#toggle").on("click", function() { $("div").toggle(500); }); $("#interval").on("click", function() { jQuery.fx.interval = 5000; }); }); </ script > </ center > </ body > </ html > |
Output:
Recommended Posts:
- jQuery | jQuery.support Property
- jQuery | jQuery.fx.off Property
- jQuery | jquery Property
- jQuery | context Property
- jQuery | length property
- jQuery | event.relatedTarget Property with Example
- jQuery | event.delegateTarget Property
- Get the numeric part of CSS property using jQuery
- jQuery | event.which property with Examples
- jQuery | event.namespace Property
- jQuery | event.timeStamp property with Example
- jQuery | event.data Property
- jQuery | event.currentTarget Property
- jQuery | event.target Property with Example
- jQuery | event.type property with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : Akanksha_Rai