I am trying to make a circle animation,
I currently have this: http://jsfiddle.net/gf327jxu/1/
<svg width="100" height="100" class="circle">
<circle cx="50" cy="50" r="40" />
</svg>
css:
.circle{
stroke:green;
stroke-width:10;
fill:none;
}
I want it animated like a circle progress, something like this: http://jsfiddle.net/andsens/mLA7X/ but in SVG,
And I need it to be clockwise, how can I achieve this, and is this even possible?
Here's a fiddle example.
Note: I used
r = 57
, since the perimeter is358.1
which is close to360 degrees
. For differentr
values, you need to calculate thestroke-dasharray
Many thanks to @Robert Longson , @Erik Dahlström and @Phrogz for SO solutions over the years. This fiddle is just one of their tweaks.