+2

How to animate <polygon> tag in SVG ?

As the polygon tag has points, what should i set the attributeName to?

4/6/2020 3:52:33 PM

Srinath

6 Answers

New Answer

+3

<svg width="1000" height="250"> <polygon points="0 0, 0 100, 100 50" fill="orange"> <animate attributeName="points" to="300 0, 300 100, 400 50" dur="3s" fill="freeze" repeatCount="2"/> </polygon> </svg>

+2

You can animate like this, and you can change every single coordinate so you can move the entire shape or a single point

+1

Do you want to move the entire polygon or only the points?

+1

Ah great!! Thanks

0

The entire polygon

0

Or what should i do for both, knowing how to move the points and also the polygon might be useful