Issue
I would like to move a circle along a circular path using HTML/CSS/JavaScript. Is there a way to achieve this? The code for circle is added below:
.circle {
width: 50px;
height: 50px;
display: block;
-webkit-border-radius: 50px;
-khtml-border-radius: 50px;
-moz-border-radius: 50px;
border-radius: 50px;
color: #fff;
background-color: #b9c1de;
}
<div class="circle"></div>
Solution
You can achieve this with pure css3. Write like this:
CSS
.dot{
position:absolute;
top:0;
left:0;
width:50px;
height:50px;
background:red;
border-radius:50%;
}
.sun{
width:200px;
height:200px;
position:absolute;
-webkit-animation-iteration-count:infinite;
-webkit-animation-timing-function:linear;
-webkit-animation-name:orbit;
-webkit-animation-duration:5s;
top:50px;
left:50px;
}
@-webkit-keyframes orbit {
from { -webkit-transform:rotate(0deg) }
to { -webkit-transform:rotate(360deg) }
}
HTML
<div class="sun">
<div class="dot"></div>
</div>
Check this http://jsfiddle.net/r4AFV/
UPDATED
Answered By - sandeep
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.