| Server IP : 146.59.209.152 / Your IP : 216.73.216.46 Web Server : Apache System : Linux webm005.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : infrafs ( 43850) PHP Version : 8.2.29 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/infrafs/www/wp-content/plugins/eltd-core/shortcodes/progress-bar/assets/js/plugins/ |
Upload File : |
/*
** Plugin for counter shortcode
*/
(function($) {"use strict"; $.fn.countTo = function(options) {options = $.extend({}, $.fn.countTo.defaults, options || {}); var loops = Math.ceil(options.speed / options.refreshInterval), increment = (options.to - options.from) / loops; return $(this).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, to: 100, speed: 1000, refreshInterval: 100, decimals: 0, onUpdate: null, onComplete: null }; })(jQuery);