incBy=Math.ceil((indOption.maxValue-indOption.minValue)/(indOption.frameNum||(indOption.percentage?100:500))),//increment by .2% on every tick and 1% if showing as percentage
back=val<counter;
//clear interval function if already started
if(this.intvFunc)clearInterval(this.intvFunc);
this.intvFunc=setInterval(function(){
if((!back&&counter>=val)||(back&&counter<=val)){
if(self.current_value==counter){
clearInterval(self.intvFunc);
return;
}else{
counter=val;
}
}
self.value(counter);//dispaly the value
if(counter!=val){
counter=counter+(back?-incBy:incBy)
};//increment or decrement till counter does not reach to value