+ 3

circle animation on html5

How can I make a circle animation? it's my code but this is not run. <svg width="1000" height="250"> <circle cx="80" cy="80" r="30" fill="orange"> <animate attributeName="x" from="0" to"300" dur="36" fill="freeze" repeatcount="3"/> </circle> </svg>

2nd Mar 2018, 9:07 AM
Arezoo Fahimi
Arezoo Fahimi - avatar
1 Resposta
+ 5
You made a syntax error 'to"300"' it'd be 'to="300"'. Also for attribute name you need the circle's attribute name which is cx in your case so attributeName="cx" since you're animating the circle's x (cx) attribute.
2nd Mar 2018, 9:25 AM
Kevin Eldurson
Kevin Eldurson - avatar