SVG Animations & Paths part 1

SVG Animations & Paths
17
1/2









Shape Animations
SVG animations can be created using the <animate> element.
The example below creates a rectangle that will change its position in 3 seconds and will then repeat the animation twice:
attributeName: Specifies which attribute will be affected by the animation
from: Specifies the starting value of the attribute
to: Specifies the ending value of the attribute
dur: Specifies how long the animation runs (duration)
fill: Specifies whether or not the attribute's value should return to its initial value when the animation is finished (Values: "remove" resets the value; "freeze" keeps the “to value”)
repeatCount: Specifies the repeat count of the animation
In the example above, the rectangle changes its x attribute from 0 to 300 in 3 seconds.
To repeat the animation indefinitely, use the value "indefinite" for the repeatCount attribute.
Comments
Post a Comment