Have you ever designed a custom animation using Jquery and found that the motion wasn’t as smooth as you would like?
There is a good chance that the choppiness was being caused by JQuery’s default high framerate.
Sometimes, especially with a complicated animations, the framerate is too high for the client to run it smoothly causing the animation to drop frames when it can’t keep up.
Many javascript frameworks allow the default framerate to be modified by developers but JQuery doesn’t give you the option at this time. It may in the future as there is a ticket out to add this functionality: http://dev.jquery.com/ticket/6726
In the meantime, I wrote up a quick JQuery plugin that allows for customization of the framerate for a project we’re currently working on that uses lots of animations. The default framerate in the stock build of jQuery 1.4.2 is @77fps. Running this plugin will reset that default to 30fps. The plugin also accepts two options: framerate and logframes. The framerate option will allow you to set the framerate to your desired speed. The logframes option, if set to true, will log the running framerate to the console anytime an animation is running.


Nice plugin. This will work perfectly for a jQuery/Joomla project I have coming up.
Awesome! Haven’t had a problem with framerates yet but I haven’t done anything too animation heavy. This will definitely come in handy.
Nice job. Looks like you have a couple global variable leaks tho: settings and timerId. Otherwise this could be handy. BTW, why BSD instead of MIT license?
That’s awesome Jim, sometimes I write off complex animations as “impossible” because of this – thanks!
Thanks Aaron. I updated the plugin, so the leaks should be fixed. Also, the license was what just happened to be on the skeleton file I used to start writing the plugin. I switched it over.
Thank you Jim. This is a brilliant plugin. My animations are buttery smooth thanks to you.
Glad you like it Elliot. The version of JQuery just released, 1.4.3, has a built in function now to change the default framerate. Doesn’t look like it has a loggin function, though, so this plugin could still be used for testing for the ideal framerate setting, assuming it works still in the newest version.
http://api.jquery.com/jQuery.fx.interval/
Amazing plugin. Works perfect !
Thanks.
Looks like the built in function to change the framerate will help me out a lot. Thanks.