
- jQuery - Home
- jQuery - Roadmap
- jQuery - Overview
- jQuery - Basics
- jQuery - Syntax
- jQuery - Selectors
- jQuery - Events
- jQuery - Attributes
- jQuery - AJAX
- jQuery CSS Manipulation
- jQuery - CSS Classes
- jQuery - Dimensions
- jQuery - CSS Properties
- jQuery Traversing
- jQuery - Traversing
- jQuery - Traversing Ancestors
- jQuery - Traversing Descendants
- jQuery References
- jQuery - Selectors
- jQuery - Events
- jQuery - Effects
- jQuery - HTML/CSS
- jQuery - Traversing
- jQuery - Miscellaneous
- jQuery - Properties
- jQuery - Utilities
- jQuery Plugins
- jQuery - Plugins
- jQuery - PagePiling.js
- jQuery - Flickerplate.js
- jQuery - Multiscroll.js
- jQuery - Slidebar.js
- jQuery - Rowgrid.js
- jQuery - Alertify.js
- jQuery - Progressbar.js
- jQuery - Slideshow.js
- jQuery - Drawsvg.js
- jQuery - Tagsort.js
- jQuery - LogosDistort.js
- jQuery - Filer.js
- jQuery - Whatsnearby.js
- jQuery - Checkout.js
- jQuery - Blockrain.js
- jQuery - Producttour.js
- jQuery - Megadropdown.js
- jQuery - Weather.js
jQuery jQuery.fx.interval Property
The jQuery.fx.interval property in jQuery controls the duration (in milliseconds) between animation frames in jQuery. The default value is 13 milliseconds.
Adjusting the milliseconds affects the smoothness and performance of animations. Lower milliseconds result in smoother animations but may consume more CPU resources. Higher milliseconds can improve performance but may make animations appear less smooth.
Syntax
Following is the syntax of jQuery jQuery.fx.interval Property −
jQuery.fx.interval = milliseconds;
Parameters
Here is the description of the above syntax −
- milliseconds: An integer specifying the interval in milliseconds between animation frames.
Example
This example demonstrates the use of the jQuery.fx.interval property to control the frame interval for animations −
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script> $(document).ready(function(){ // Set the animation frame interval to 50 milliseconds jQuery.fx.interval = 50; $("#animateBox").animate({left: '+=200px'}, 2000); }); </script> <style> #animateBox { width: 50px; height: 50px; background-color: red; position: relative; } </style> </head> <body> <div id="animateBox"></div> </body> </html>
By setting jQuery.fx.interval to 50 milliseconds, the animation of the red box moving 200 pixels to the right over 2 seconds will be less smooth compared to the default setting.