Saturday, 14 September 2013

How to reuse animation in SVG without javascript

How to reuse animation in SVG without javascript

I want to reuse tags without javascript but can't find a way. something
like this:
<svg>
<defs>
<animation id="shrink"
attributeName="width"
from="100%" to="0%"
dur="5s"
repeatCount="1"
fill="freeze" />
</defs>
<rect
width="100%" height="10%"
fill="blue"
animate="#shrink"/>
</svg>
But all the examples I find have the animation inside the tag or they use
javascript/jQuery etc.
there must be a way since you can reuse graphics gradients and masks.
thanks for your help!

No comments:

Post a Comment