| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 | 
							- $(document).ready(function (){
 
-  	var win = $(window).height();
 
-  	var height = $('.counter').offset().top;
 
-    	var Counter = 1;
 
-    	$(window).scroll(function () {
 
- 		if($(document).scrollTop() < (height-win+100) && Counter==1){
 
- 			$('.counter').each(function(){
 
- 				var dataperc = $(this).attr('data-perc');
 
- 				$(this).delay(5000).countTo({
 
- 					from: 0,
 
- 					to: dataperc,
 
- 					speed: 5000,
 
- 					refreshInterval: 100
 
- 				});
 
- 				Counter = 0;
 
- 			});
 
- 		}
 
- 	});
 
- });
 
- $.fn.countTo = function(options) {
 
- 	// merge the default plugin settings with the custom options
 
- 	options = $.extend({}, $.fn.countTo.defaults, options || {});
 
- 	// how many times to update the value, and how much to increment the value on each update
 
- 	var loops = Math.ceil(options.speed / options.refreshInterval),
 
- 		increment = (options.to - options.from) / loops;
 
- 	return $(this).delay(1000).each(function() {
 
- 		var _this = this,
 
- 			loopCount = 0,
 
- 			value = options.from,
 
- 			interval = setInterval(updateTimer, options.refreshInterval);
 
- 		function updateTimer() {
 
- 			value += increment;
 
- 			loopCount++;
 
- 			$(_this).html(value.toFixed(options.decimals));
 
- 			if (typeof(options.onUpdate) == 'function') {
 
- 				options.onUpdate.call(_this, value);
 
- 			}
 
- 			if (loopCount >= loops) {
 
- 				clearInterval(interval);
 
- 				value = options.to;
 
- 				if (typeof(options.onComplete) == 'function') {
 
- 					options.onComplete.call(_this, value);
 
- 				}
 
- 			}
 
- 		}
 
- 	});
 
- };
 
- $.fn.countTo.defaults = {
 
- 	from: 0,	// the number the element should start at
 
- 	to: 100,	// 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
 
- 	onUpdate: null,	//callback method for every time the element is updated,
 
- 	onComplete: null,//callback method for when the element finishes updating
 
- };
 
 
  |