Assignment029j3a2aJ - Keyframes (from and to) with JavaScript

CSS keyframes allow you animate elements, but we want control over when keyframes animations begin. In the following example we control when the keyframes animation begins with a JavaScript event handler. Our JavaScript code will toggle the animation on and off by adding and removing a class (with animation code) to an element.

As in a previous assignment, we specify animation names for the elements we want to animate and provide @keyframes code blocks.

Click on the div element below to run JavaScript and begin or end the animation.

Spin Forever

In order to get credit for this assignment, your animation must be different than the one above. The more complex the better. You can earn an A only if you animate an image.