I created progressbar with help of lib jquery.knobs.js: example
this is my code:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="js/jquery.knob.js"></script>
<script>
$(function() {
$(".knob").knob();
var val,up=0,down=0,i=0
,$idir = $("div.idir")
,$ival = $("div.ival")
,incr = function() { i++; $idir.show().html("+").fadeOut(); $ival.html(i); }
,decr = function() { i--; $idir.show().html("-").fadeOut(); $ival.html(i); };
$("input.infinite").knob(
{
'min':0
,'max':20
,'stopper':false
,'change':function(v){
if(val>v){
if(up){
decr();
up=0;
}else{up=1;down=0;}
}else{
if(down){
incr();
down=0;
}else{down=1;up=0;}
}
val=v;
}
}
); });
</script>
<style>
h2{color:#87CEEB;font-family:'Georgia';}
</style>
</head>
<body>
<h1>Процент запросов в топе для сайта <?php echo $site; ?></h1>
<div style="float:left; width:300px; height:320px; padding:20px">
<input class="knob" data-fgColor="#9dc806" data-cgColor="black" data-bgColor="#7d7d7d" data-tickColor="black" data-thickness=".25" data-readOnly=true value="<?php echo $percent; ?>">
</div>
I want to change color of the number to black and add percent signature to the number?
In your setup, change
If you’d like to only change the color of your number, just hack your CSS with this –
Also, as far as adding a percentage, just run this on DOM ready –
Here is the documentation I found through Google –
http://anthonyterrien.com/knob/