O'Reilly logo

Sams Teach Yourself SVG in 24 Hours by Micah Laaker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Enhancing Animation Performance

One of the most useful tasks you can rely on JavaScript to perform is that of animation. JavaScript is very adept at injecting animation into otherwise static graphics. Even though SVG supports animation, it can be advantageous in terms of performance to use JavaScript as a means of adding animation to SVG documents. This has to do with the fact that most Web browsers are optimized to execute JavaScript code very efficiently.

When you use JavaScript to animate an SVG document, the browser's JavaScript engine handles the chore of carrying out the SVG animation, generally resulting in speed and performance improvements. To test this possibility, you can apply some object-oriented JavaScript to the news center graphic ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required