(function($, window){ var ProfiTheme = window.ProfiTheme || {}; ProfiTheme.Counter = function(){ $('.counter').each(function() { var finishValue = parseInt(this.innerText,10); $(this).waypoint(function(dir) { var _self = this; var counter = { var: 0 }; TweenMax.to(counter, 1, { var: finishValue, onUpdate: function () { _self.element.textContent = ~~counter.var; }, ease:Circ.easeOut }); }, { offset: "90%", triggerOnce: true }); }); }; ProfiTheme.Loader.done(ProfiTheme.Counter); })(jQuery, window);