jquery - Making a progress bar in a circle -
jquery - Making a progress bar in a circle -
i need create 'health' progress bar project, greenish represents filled in info , reddish empty data. got nice circle when reddish part 50%, value changes else border-radius messed up..
here have @ moment:
html:
<div id="progresswrap"> <span class="progressred"></span> </div>
css:
#progresswrap { width: 50px; height: 50px; display: block; background-color: forestgreen; -webkit-border-radius: 100%; -moz-border-radius: 100%; -ms-border-radius: 100%; border-radius: 100%; } .progressred { width: 50%; height: 50px; float: right; background-color: red; border-bottom-right-radius: 25px; border-top-right-radius: 25px; }
http://jsfiddle.net/q48qf/
the width value of progressred class going dynamic jquery, perhaps alter border-radius create fit progresswrap again? wouldn't know how calculate border-radius needed in case.
any help much appreciated!
the reddish part doesn't need border radius. since it's wrapped exclusively in greenish circle, it's easier allow remain square , hide overflow parent.
set overflow: hidden
on parent (green) part, , remove radii red.
example: http://jsfiddle.net/q48qf/3/
jquery html css
Comments
Post a Comment