Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery jQuery.fx.interval Property

jQuery jQuery.fx.interval Property

jQuery Properties jQuery Properties

Example

Run with fewer frames

animation of an element:

$

(

"

#toggle

"

)

.

on

(

"

click

"

,

function

(

)

{

$

(

"

div

"

)

.

toggle

(

5000

)

;

}

)

; $

(

"

#interval

"

)

.

on

(

"

click

"

,

function

(

)

{

jQuery

.

fx

.

interval

=

500

;

}

)

;

Try it »


Definition and Usage

The jQuery.fx.interval property is used to change the rate at which animations run, measured in milliseconds.

The default value is 13 milliseconds. This property is commonly used to modify the number of frames per second at which animations run. Lowering this value can make animations run more smoothly in faster browsers, but doing so affects performance and CPU.

**Note:** Since jQuery uses a global interval, for this property to take effect, no animations should be running, or all animations should be stopped first.

**Note:** This property has no effect in browsers that support the requestAnimationFrame property, such as Google Chrome 11.


Syntax

jQuery.fx.interval =

milliseconds

;

Parameters Description
milliseconds Required. Specifies the rate at which animations run, in milliseconds. The default is 13 milliseconds.

jQuery Properties jQuery Properties