Skip to Content

JavaScript File

URL: https://www.tantrafuengirola.com/wp-content/plugins/mikado-core/shortcodes/counter/assets/js/plugins/counter.js?ver=6.1.1
HTTP Status: 200 OK
MIME Type: application/javascript
Last Modified: Mon, 04 Oct 2021 10:03:13 GMT
Download Time: Less than a second
Cookies: None
Size: 1 KB
HTTP Headers:  8 headers
Links In:  1 pages
Links Out:  0 links
Images:  0 images
CSS:  0 files
JavaScript:  0 files
OK Issues: No issues found

1/*

2 ** Plugin for counter shortcode

3 */

4(function($) {"use strict"; $.fn.countTo = function(options) {options = $.extend({}

5, $.fn.countTo.defaults, options || {}

6); 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); }

7 if (loopCount >= loops) {clearInterval(interval); value = options.to; if (typeof(options.onComplete) === 'function') {options.onComplete.call(_this, value); }

8 }

9 }

10 }

11); }

12; $.fn.countTo.defaults = {from: 0, to: 100, speed: 1000, refreshInterval: 100, decimals: 0, onUpdate: null, onComplete: null }

13; }

14)(jQuery);