Chapter 5 Animation

Are you ready for your journey into the … fourth dimension!? (Cue spooky theramin music.)

Animation is all about time—stopping time, starting time, and bending time to produce the effect you want: movement. You don’t actually have to learn much new JavaScript in order to create web page animation—just two little functions. One and a half, really. What are they? You’ll have to read on to find out!

But first, let’s take a look at exactly what animation is, and how we can best go about producing it on a computer screen.

The Principles of Animation

If, like me, you’re a connoisseur of Saturday morning cartoons, you’ll probably be familiar with the basic principles of animation. As illustrated in Figure 5.1, what ...

Get Simply JavaScript 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.