Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set different frame rate for each animation in jQuery

I know the frame rate in jQuery could be set through jQuery.fx.interval. However, it applies to all the jQuery internal animate function such as slideDown, fadeIn and animateetc.

I want to set frame rate for each animate(), how could I archieve that?

like image 792
steveyang Avatar asked Nov 21 '11 10:11

steveyang


1 Answers

From the API documentation page:

Since jQuery uses one global interval, no animation should be running or all animations should stop for the change of this property to take effect.

Note: jQuery.fx.interval currently has no effect in browsers that support the requestAnimationFrame property, such as Google Chrome 11. This behavior is subject to change in a future release.

I take from this that you cannot set the frame rate for an individual animate call, unless you were willing to have no animations until that one had completed, and even then you can't guarantee the behaviour. It's probably best to leave the setting alone.

like image 114
lonesomeday Avatar answered Nov 15 '22 01:11

lonesomeday