Question

Just wondering if anyone has any idea how I can Prerender Animations in jQuery. Basically the first time I run an animation it is jerky... but from then on when I run it, it runs perfectly smooth...

Any ideas?

Was it helpful?

Solution

There's no way (that I know of) to do what you're asking.

Javascript animations are done by transitioning from one CSS value to another (like margin, top, width, height, etc). I don't really see how you could "pre-render" this. The only thing I can think of is pre-defining the sequence of values which will be applied in CSS (if you're using complicated exponential or trigonometric functions easing). Even then, it's not something you would do (necessarily) with jQuery.

Do you have an example of your jerky animation that suddenly runs smoother?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top