Using the set Element

Now comes the fun part. One of the most basic animation and interaction elements is the set element. The set element doesn't so much animate items as it explicitly changes their attributes. As such, it provides a perfect example of basic interaction.

Taking advantage of what you learned with timing and event triggers in the last hour, you can use the set element to modify elements or groups in a number of ways. For example, you can make an item disappear, flip over, change color, change position, and more.

The set element uses several common attributes to operate. These are detailed in Table 13.1.

Table 13.1. set Element Attributes
set Attribute Attribute Function
xlink:href Similar to the use element, set usually relies ...

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.