views:

29

answers:

1

I've made an animation with SVG. It's like a slowly changing wallpaper. The idea is that you should barely notice it is changing.

It's purely decorative, and I don't want it to drain any resources. Is there a way to set the frame rate in SVG? I thought setting it to a very low number might do the trick? I'm using Raphael, by the way.

A: 

Deep in Raphael's guts, you will find the logic that controls the frame rate for non-keyframe animations:

animationElements[length] && setTimeout(animation);

By omitting an actual timeout value, Raphael is basically telling the browser to run the method as fast as it can (within scheduling constraints provided by the DOM specification and the browser implementation). You could either tweak that function to use a user-supplied parameter (or put a number there, though that will affect all animations), or use Peter's suggestion.

C-Mo