O'Reilly logo

Special Edition Using XML, Second Edition by - et al. David Gulbransen

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

Declarative SVG Animations

You have already seen in this chapter several SVG animations. In this section, I will give you some more examples that will more fully illustrate some of the options available to you.

In SVG animations, you “declare” what you want to happen. You say which attribute you want to change, when you want the animation to start, how long it should take, what its starting value should be, what it's completion value should be, whether it repeats, and whether—when the animation has completed—the animated value is held or the original visual appearance is resumed.

So, suppose that we had code like the following:

<animate attributeName="x" begin="2s" dur="5s" 
from="50" to="800" repeatCount="5" fill="freeze"/>

We declare that ...

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