1jQuery(document).ready(function() { 2 "use strict"; 3 /** 4 * Skip link focus fix 5 */ 6 ( function() { 7 var is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1, 8 is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1, 9 is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1; 10 11 if ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) { 12 window.addEventListener( 'hashchange', function() { 13 var element = document.getElementById( location.hash.substring( 1 ) ); 14 15 if ( element ) { 16 if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) 17 element.tabIndex = -1; 18 19 element.focus(); 20 } 21 }, false ); 22 } 23 })(); 24 25 /** 26 * Responsive Videos 27 */ 28 ( function() { 29 jQuery('.site-content').fitVids(); 30 })(); 31 32 /** 33 * Initialise Menu Toggle 34 */ 35 ( function() { 36 var header_h = jQuery('.site-header').height(); 37 var header_widget_h = jQuery('.header-widget').height(); 38 39 jQuery('.wpc-menu li.menu-item-has-children').each( function() { 40 jQuery(this).prepend('<div class="nav-toggle-subarrow"><i class="fa fa-angle-down"></i></div>'); 41 }); 42 43 jQuery('#nav-toggle').click( 44 function () { 45 46 jQuery('.main-navigation .wpc-menu').toggleClass("wpc-menu-mobile"); 47 jQuery('.header-widget').toggleClass("header-widget-mobile"); 48 jQuery('.header-widget-mobile').css('top', header_h); 49 jQuery('.wpc-menu-mobile').css('top', header_h + header_widget_h + 20); 50 } 51 ); 52 jQuery('.nav-toggle-subarrow, .nav-toggle-subarrow .nav-toggle-subarrow').click( 53 function () { 54 jQuery(this).parent().toggleClass("nav-toggle-dropdown"); 55 } 56 ); 57 58 } )(); 59 60 /** 61 * Initialise transparent header 62 */ 63 ( function() { 64 65 var site_header_h = jQuery('.site-header').height(); 66 var logo_h = jQuery('.site-branding img').height(); 67 var nav_h = jQuery('.wpc-menu').height() - 30; 68 var page_header = jQuery('.page-header-wrap'); 69 var page_header_pt = parseInt(page_header.css('padding-top'), 10); 70 //alert(page_header_pt); 71 //alert(nav_h); 72 73 // Vertical Align Logo 74 //jQuery('.site-branding').css('padding-top', (site_header_h - logo_h) / 2 + 'px'); 75 76 // Single Page transparent header. 77 if ( jQuery('body').hasClass('header-transparent') && page_header.length ) { 78 page_header.css('padding-top', page_header_pt + site_header_h + 'px'); 79 } 80 81 })(); 82 83 /** 84 * Parallax Section 85 */ 86 ( function() { 87 var isMobile = { 88 Android: function() { 89 return navigator.userAgent.match(/Android/i); 90 }, 91 BlackBerry: function() { 92 return navigator.userAgent.match(/BlackBerry/i); 93 }, 94 iOS: function() { 95 return navigator.userAgent.match(/iPhone|iPad|iPod/i); 96 }, 97 Opera: function() { 98 return navigator.userAgent.match(/Opera Mini/i); 99 }, 100 Windows: function() { 101 return navigator.userAgent.match(/IEMobile/i); 102 }, 103 any: function() { 104 return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); 105 } 106 }; 107 108 var testMobile = isMobile.any(); 109 110 jQuery('.wpc_row_parallax').each(function() { 111 var $this = jQuery(this); 112 var bg = $this.find('.wpc_parallax_bg'); 113 114 jQuery(bg).css('backgroundImage', 'url(' + $this.data('bg') + ')'); 115 116 if (testMobile == null) { 117 jQuery(bg).addClass('not-mobile'); 118 jQuery(bg).removeClass('is-mobile'); 119 jQuery(bg).parallax('50%', 0.4); 120 } 121 else { 122 //jQuery(bg).css('backgroundAttachment', 'inherit'); 123 jQuery(bg).removeClass('not-mobile'); 124 jQuery(bg).addClass('is-mobile'); 125 126 } 127 128 }); 129 130 })(); 131 132 /**
133 * Call magnificPopup when use 134 */ 135 ( function() { 136 137 // WordPress gallery lightbox 138 jQuery('.gallery-lightbox').magnificPopup({ 139 delegate: '.gallery-item a', 140 type:'image', 141 gallery:{ 142 enabled:true 143 }, 144 zoom: { 145 enabled:true 146 } 147 }); 148 149 jQuery('.popup-video').magnificPopup({ 150 //disableOn: 700, 151 type: 'iframe', 152 mainClass: 'mfp-fade', 153 removalDelay: 160, 154 preloader: false, 155 fixedContentPos: false, 156 zoom: { 157 enabled:true 158 } 159 }); 160 161 })(); 162 163 /** 164 * Fix slider padding issue. 165 */ 166 ( function() { 167 jQuery('.rev_slider_wrapper').parents('.vc_row').find('.vc_col-sm-12').css({"padding-left": "0px","padding-right": "0px"}); 168 })(); 169 170 /** 171 * Back To Top 172 */ 173 ( function() { 174 jQuery('#btt').fadeOut(); 175 jQuery(window).scroll(function() { 176 if(jQuery(this).scrollTop() != 0) { 177 jQuery('#btt').fadeIn(); 178 } else { 179 jQuery('#btt').fadeOut(); 180 } 181 }); 182 183 jQuery('#btt').click(function() { 184 jQuery('body,html').animate({scrollTop:0},800); 185 }); 186 })(); 187 188 /** 189 * Fixed Header + Navigation. 190 */ 191 ( function() { 192 193 if ( header_fixed_setting.fixed_header == '1' ) { 194 var header_fixed = jQuery('.fixed-on'); 195 var p_to_top = header_fixed.position().top; 196 197 198 jQuery(window).scroll(function(){ 199 if(jQuery(document).scrollTop() > p_to_top) { 200 header_fixed.addClass('header-fixed'); 201 header_fixed.stop().animate({},300); 202 if ( jQuery("body").hasClass('header-transparent') ) { 203 // No Thing 204 } else { 205 jQuery('.site-content').css('padding-top', header_fixed.height()); 206 } 207 208 } else { 209 header_fixed.removeClass('header-fixed'); 210 header_fixed.stop().animate({},300); 211 if (jQuery("body").hasClass('header-transparent') ) { 212 // No Thing 213 } else { 214 jQuery('.site-content').css('padding-top', '0'); 215 } 216 } 217 }); 218 } 219 220 })(); 221 222});
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.