How to animate a circle | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to animate a circle

I dont know this , please can help me? I dont move a circle to right. in HTML5 <svg width=300 height=70><circle width=30 height=70 cx=30 cy=30 r=30 <animate attributeName=x from=0 to=300 dur="3s" repeatCount="10"></circle></svg> ?????

11th Jan 2020, 4:10 PM
🇷🇴Golden Fish🇷🇴
9 Answers
+ 4
Golden Fish , Corrections: 1.quote attribute values, not compulsory as long as you use pixel unit but would help if you choose to make changes in unit. 2.circle svg element don't have height and width property. they have a radius defined with attribute "r" so remove height and width. 3. Circle has cx and cy attribute (x and y coordinates of its center) so attributeName="cx" not x Corrected version: <svg width="300" height="70"> <circle cx="30" cy="30" r="30"> <animate attributeName="cx" from="0" to="300" dur="3s" repeatCount="10"> </circle> </svg>
11th Jan 2020, 4:56 PM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar
+ 3
with CSS or JavaScript ? as the circle can be created in SVG, CSS, or JavaScript and animated with CSS and or Javascript...
11th Jan 2020, 4:28 PM
BroFar
BroFar - avatar
+ 2
In html?
11th Jan 2020, 4:23 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 2
Golden Fish are you simply wanting to <marquee> movement
11th Jan 2020, 4:32 PM
BroFar
BroFar - avatar
11th Jan 2020, 4:46 PM
BroFar
BroFar - avatar
+ 2
First of all draw a circle by canvas or svg tag in html then use animation or transition in js to move it, this is all the basic of simple movement.
12th Jan 2020, 2:19 PM
Abhishek nirwan
Abhishek nirwan - avatar
+ 1
This question is vague... can you please detail this more?
11th Jan 2020, 4:14 PM
BroFar
BroFar - avatar
+ 1
Don't use marquee it's deprecated. see this lesson to understand svg animations : https://www.sololearn.com/learn/HTML/2213/?ref=app
11th Jan 2020, 4:44 PM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar
+ 1
in css3 you can animate it easily with transform : translate(x,y,z); proerties.
13th Jan 2020, 12:41 AM
‎محمد عبدالكريم ابوخشيم‎
‎محمد عبدالكريم ابوخشيم‎ - avatar