Animating with pure JavaScript

Before there were CSS keyframe animations and CSS transitions, two techniques we'll look at later in this chapter, we had to produce all of our animations and interesting effects in the browser by hand using JavaScript; updating properties in a loop and optimizing frame rates manually. Eventually, libraries such as jQuery came along and removed the need to know how this worked, by presenting animations as part of their API. Thankfully, these days, in addition to the animation methods available in your tool of choice, you can leverage CSS animations for many things we used to use JavaScript for so there's less and less need for people to learn these skills these days.

That said, there are places where CSS animations ...

Get Mastering SVG now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.