1 2;(function($) { 3 4 'use strict' 5 6 var responsiveMenu = function() { 7 var menuType = 'desktop'; 8 9 $(window).on('load resize', function() { 10 var currMenuType = 'desktop'; 11 12 if ( matchMedia( 'only screen and (max-width: 991px)' ).matches ) { 13 currMenuType = 'mobile'; 14 } 15 16 if ( currMenuType !== menuType ) { 17 menuType = currMenuType; 18 19 if ( currMenuType === 'mobile' ) { 20 var $mobileMenu = $('#mainnav').attr('id', 'mainnav-mobi').hide(); 21 var hasChildMenu = $('#mainnav-mobi').find('li:has(ul)'); 22 23 hasChildMenu.children('ul').hide(); 24 hasChildMenu.children('a').after('<span class="btn-submenu"></span>'); 25 $('.btn-menu').removeClass('active'); 26 } else { 27 var $desktopMenu = $('#mainnav-mobi').attr('id', 'mainnav').removeAttr('style'); 28 29 $desktopMenu.find('.sub-menu').removeAttr('style'); 30 $('.btn-submenu').remove(); 31 } 32 } 33 }); 34 35 $('.btn-menu').on('click', function() { 36 $('#mainnav-mobi').slideToggle(300); 37 $(this).toggleClass('active'); 38 }); 39 40 $(document).on('click', '#mainnav-mobi li .btn-submenu', function(e) { 41 $(this).toggleClass('active').next('ul').slideToggle(300); 42 e.stopImmediatePropagation() 43 }); 44 } 45 46 var responsiveVideo = function(){ 47 if ( $().fitVids ) { 48 $('body').fitVids(); 49 } 50 }; 51 52 var tabs = function() { 53 $('.tabs').each(function() { 54 var el = $(this); 55 el.find('.content').hide(); 56 el.find('.menu-tab > li').on('click', function(e) { 57 var liActive = $(this).index(); 58 var contentActive = $(this).parents('.tabs').find('.content').eq(liActive); 59 60 $(this).addClass('active').siblings().removeClass('active'); 61 contentActive.fadeIn().siblings().hide(); 62 63 e.preventDefault(); 64 }).filter('.active').trigger('click'); 65 }); 66 }; 67 68 var postsCarousel = function() { 69 if ( $().owlCarousel ) { 70 var container = $('.roll-posts-carousel'); 71 var imgLoad = imagesLoaded(container); 72 imgLoad.on( 'always', function() { 73 container.each(function(){ 74 var $this = $(this); 75 $this.find('.owl-carousel').owlCarousel({ 76 autoplay: $this.data('auto'), 77 loop: true, 78 margin: 30, 79 dots: false, 80 nav: true, 81 autoplayTimeout: $this.data('speed'), 82 autoHeight: true, 83 navText: [ '<i class="fa fa-arrow-left"></i>', '<i class="fa fa-arrow-right"></i>' ], 84 responsive:{ 85 0:{ 86 items: 1 87 }, 88 480:{ 89 items: 2 90 }, 91 991:{ 92 items: $this.data('items') 93 } 94 } 95 }); 96 }); 97 }); 98 } // end if 99 }; 100 101 var goTop = function() { 102 $(window).scroll(function() { 103 if ( $(this).scrollTop() > 600 ) { 104 $('.go-top').addClass('show'); 105 } else { 106 $('.go-top').removeClass('show'); 107 } 108 }); 109 110 $('.go-top, .go-top2').on('click', function() { 111 $("html, body").animate({ scrollTop: 0 }, 1000); 112 return false; 113 }); 114 115 $(window).on('load scroll', function() { 116 $('.go-top2').each(function(e) { 117 if ( this.getBoundingClientRect().top < $(window).height() ) { 118 $('.go-top').addClass('hide'); 119 $('.go-top2').addClass('show'); 120 } else { 121 $('.go-top').removeClass('hide'); 122 $('.go-top2').removeClass('show'); 123 } 124 }) 125 }) 126 }; 127 128 var removePreloader = function() { 129 $('.preloader').css('opacity', 0); 130 setTimeout(function(){$('.preloader').hide();}, 600); 131 } 132 133 134 // DOM Ready 135 $(function() { 136 responsiveMenu(); 137 responsiveVideo(); 138 tabs(); 139 goTop(); 140 postsCarousel(); 141 removePreloader(); 142 }); 143 144})(jQuery);
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.