1/** 2 *------------------------------------------------------------------------------ 3 * @package T3 Framework for Joomla! 4 *------------------------------------------------------------------------------ 5 * @copyright Copyright (C) 2004-2017 JoomlArt.com. All Rights Reserved. 6 * @license GNU General Public License version 2 or later; see LICENSE.txt 7 * @authors JoomlArt, JoomlaBamboo, (contribute to this project at github 8 * & Google group to become co-author) 9 * @Google group: https://groups.google.com/forum/#!forum/t3fw 10 * @Link: http://t3-framework.org 11 *------------------------------------------------------------------------------ 12 */ 13 14// count up 15(function($) { 16 17 function CountUp(element, options){ 18 this.$element = $(element); 19 this.$counter = this.$element.find('.count-up'); 20 this.$progress = this.$element.find('.pro-bar'); 21 this.options = options; 22 this.value = options.from; 23 this.$element 24 .on('mouseenter', $.proxy(this.run, this)); 25 } 26 27 CountUp.prototype = { 28 run: function(){ 29 30 if(this.$element.hasClass('start')){ 31 return; 32 } 33 this.$element.addClass('start'); 34 this.$counter.stop(true).css('display', 'block').fadeTo(250, 1).siblings('.face').css('display', 'none'); 35 $(this).stop(true).animate({ 36 value: this.options.to 37 }, { 38 step: function(now){ 39 this.$counter.html(Math.round(now) + '%'); 40 }, 41 duration: this.options.duration, 42 complete: function(){ 43 44 setTimeout($.proxy(function(){ 45 this.$counter.delay(250).parent().children().css({display: '', opacity: ''}); 46 this.$progress.css('display', ''); 47 }, this), 250); 48 49 //clean 50 this.$element.off('mouseenter'); 51 } 52 }); 53 54 this.$progress.css({width: '0%', display: 'block'}).animate({ 55 width: this.options.to + '%' 56 }, this.options.duration); 57 } 58 } 59 60 CountUp.defaults = { 61 from: 0, 62 to: 100, 63 duration: 2000 64 } 65 66 $.fn.countup = function (option) { 67 return this.each(function () { 68 var 69 $this = $(this), 70 data = $this.data('countup'), 71 options = $.extend({}, CountUp.defaults, $this.data(), typeof option == 'object' && option), 72 action = typeof option == 'string' ? option : false; 73 74 if (!data){ 75 $this.data('countup', (data = new CountUp(this, options))) 76 } 77 78 if (action && data[action]){ 79 data[action]() 80 } 81 }) 82 } 83 84})(jQuery); 85 86// kickstart 87(function($){ 88 89 $(document).ready(function(){ 90 // fix mega menu 91 $('.t3-navbar .t3-megamenu ul li > a').click(function(e){ 92 if ($(this).hasClass('dropdown-toggle')) { 93 window.location.href = $(this).attr('href'); 94 } 95 }); 96 97 //init count up 98 (function(){ 99 $('[data-js="count-up"]').countup(); 100 })(); 101 }); 102 103})(jQuery); 104 105
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.