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 ...
Get Sams Teach Yourself SVG in 24 Hours now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.