How to animate svg polygon and lines | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 18

How to animate svg polygon and lines

<animate attributeType="" attributeName="x" from="100px" to="300px" dur="3s" repeatCount="indefinite" > This tag doesn't work on my code

31st Jan 2019, 6:17 AM
Surafel
Surafel - avatar
3 Answers
+ 6
// Hi Surafel, If <polygon> and <line> tag doesn't work with <animate>, you can use CSS for the animations. // P.S : Please, use the search bar before publishing your question. https://www.sololearn.com/discuss/1568254/?ref=app https://www.sololearn.com/discuss/1603811/?ref=app https://www.sololearn.com/discuss/1625535/?ref=app https://www.sololearn.com/discuss/1655144/?ref=app https://www.sololearn.com/discuss/1566377/?ref=app
31st Jan 2019, 7:52 AM
program
program - avatar
+ 2
Can you please supply your code so we can look at it?
31st Jan 2019, 6:23 AM
Rowsej
Rowsej - avatar
+ 2
<path id="path1" d=" M 0, 0 L 200, 0"/> <polygon points="165 200, 215 200, 190 100 " style="fill:gray; stroke:black;"> <animateMotion dur="3s" repeatCount="indefinite"> <mpath xlink:href="#path1"/> </animateMotion> </polygon>
31st Jan 2019, 2:02 PM
Игорь Яковенко
Игорь Яковенко - avatar