(function(factory){
if(typeof define ==='function'&& define.amd){
// AMDdefine(['jquery'], factory);}elseif(typeof exports ==='object'){
// CommonJSfactory(require('jquery'));}else{
// Browser globalsfactory(jQuery);}}(function($){
varCountTo=function(element, options){
this.$element =$(element);this.options = $.extend({
}, CountTo.DEFAULTS,this.dataOptions(), options);this.init();};
CountTo.DEFAULTS={
from:0,// the number the element should start at
to:0,// the number the element should end at
speed:1000,// how long it should take to count between the target numbers
refreshInterval:100,// how often the element should be updated
decimals:0,// the number of decimal places to show
formatter: formatter,// handler for formatting the value before rendering
onUpdate:null,// callback method for every time the element is updated
onComplete:null// callback method for when the element finishes updating};CountTo.prototype.init=function(){
this.value =this.options.from;this.loops = Math.ceil(this.options.speed /this.options.refreshInterval);this.loopCount =0;this.increment =(this.options.to -this.options.from)/this.loops;};CountTo.prototype.dataOptions=function(){
var options ={
from:this.$element.data('from'),
to:this.$element.data('to'),
speed:this.$element.data('speed'),
refreshInterval:this.$element.data('refresh-interval'),
decimals:this.$element.data