1jQuery(document).ready(function(){ 2 3 var $topbar = jQuery('.kl-top-bar'), 4 topbarHeight = $topbar.innerHeight(), 5 headerHeight = 0, 6 headerType = jQuery('.kl-header').data('kl-header'), 7 stickyTop = ( headerType == 'header1' ) ? '60px' : ( topbarHeight ? '100px' : '160px' ); 8 9 function fix_header(){ 10 if( topbarHeight ){ 11 12 if( headerType === 'header1'){ 13 headerHeight = jQuery('.header1 .inner-header').innerHeight() + topbarHeight; 14 } 15 if( headerType === 'header2' ){ 16 headerHeight = topbarHeight; 17 } 18 } 19 20 else { 21 if( headerType === 'header1'){ 22 headerHeight = jQuery('.header1 .inner-header').innerHeight(); 23 } 24 if( headerType === 'header2' ){ 25 headerHeight = 0; 26 } 27 } 28 } 29 30 function stickyHeader(){ 31 32 if( jQuery(window).scrollTop() > headerHeight ){ 33 jQuery('#kl-navigation').addClass('sticky'); 34 jQuery('body').css('margin-top', stickyTop); 35 } 36 else { 37 jQuery('#kl-navigation').removeClass('sticky'); 38 jQuery('body').css('margin-top', '0px'); 39 } 40 41 } 42 43 /* BACK TO TOP */ 44 jQuery('.scroll-top .back-to-top').on( 'click', function (e) { 45 e.preventDefault(); 46 jQuery( 'html, body' ).animate( { scrollTop: 0 }, 700 ); 47 }); 48 49 jQuery(window).scroll(function() { 50 51 /* STICKY HEADER */ 52 stickyHeader(); 53 54 /* SHOWS BACK TO TOP BUTTON */ 55 if( jQuery(this).scrollTop() > 100 ){ 56 jQuery('.scroll-top').addClass('show'); 57 } 58 else { jQuery('.scroll-top').removeClass('show'); } 59 60 }); 61 62 // HEADER 1 SEARCH BAR 63 jQuery('.kl-search').on( 'click', '.btn-search',function (e){ 64 e.preventDefault(); 65 jQuery('.search-field').fadeToggle(); 66 jQuery('.search-field input.search-input').focus(); 67 }); 68 69 /* RELATED POSTS SLIDER */ 70 jQuery('[data-behaviour~=kl-related-posts]').each( function () { 71 var $this = jQuery( this ), 72 slide = 3, 73 infinity = true, 74 autoplay = $this.data('auto'), 75 dots_show = $this.data('dots'), 76 arrows_show = $this.data('arrows'); 77 $this.slick({ 78 infinite : infinity, 79 slidesToShow : slide, 80 slidesToScroll: slide, 81 dots : dots_show, 82 autoplay : autoplay, 83 autoplaySpeed : 5000, 84 speed : 300, 85 arrows : arrows_show, 86 nextArrow : '<button type="button" class="slick-next slick-nav"><i class="fa fa-angle-right"></i></button>', 87 prevArrow : '<button type="button" class="slick-prev slick-nav"><i class="fa fa-angle-left"></i></button>', 88 responsive : [ 89 { 90 breakpoint: 1169, 91 settings : { 92 slidesToShow : 2, 93 slidesToScroll: 2 94 } 95 }, 96 { 97 breakpoint: 480, 98 settings : { 99 slidesToShow : 1, 100 slidesToScroll: 1 101 } 102 } 103 ] 104 }); // slick 105 106 $this.addClass( 'loaded' ); 107 }); 108 109 /* KL FEATURED SLIDER */ 110 jQuery( '.kl-featured-slider' ).each( function () { 111 var $this = jQuery( this ), 112 autoplay = $this.data( 'auto' ), 113 autotime = $this.data( 'autotime' ), 114 autospeed = $this.data( 'speed' ); 115 116 $this.slick( { 117 dots : false, 118 infinite : true, 119 speed : autospeed, 120 autoplaySpeed : autotime, 121 slidesToShow : 1, 122 slidesToScroll: 1, 123 autoplay : autoplay, 124 centerMode : false, 125 variableWidth : false, 126 adaptiveHeight: true, 127 nextArrow : '<button type="button" class="slick-next slick-nav"><i class="fa fa-angle-right"></i></button>', 128 prevArrow : '<button type="button" class="slick-prev slick-nav"><i class="fa fa-angle-left"></i></button>' 129 } ); 130 131 // PAUSE SLIDESHOW 132 if( $this.hasClass('slideshow') ){ 133 134 $this.mouseover( function() { 135 $this.slick('slickPause'); 136 }); 137 138 $this.mouseout( function() { 139 $this.slick('slickPlay') 140 }); 141 142 } 143 144 $this.parent().addClass( 'loaded' ); 145 } ); // each 146 147 148 /* HEADER 1 MOBILE NAVBAR */ 149 jQuery( '#mobile-nav.header-1 .menu .dropdown > a, #mobile-nav.header-1 .topbar-menu .dropdown > a' ).append( '<span class="menu-toggler"><i class="fa fa-angle-down"></i></span>' ); 150 151 // TOGGLE MOBILE MENU 152 jQuery('.button-menu-mobile').on('click', function(){ 153 jQuery('body' ).addClass('show-mobile-nav'); 154 }); 155 156 // MENU TOGGLER 157 jQuery('#mobile-nav.header-1 .menu-toggler').on('click', function(e){ 158 e.preventDefault(); 159 var $this = jQuery( this ); 160 161 if($this.children().hasClass('fa-angle-down')){ 162 $this.children().removeClass('fa-angle-down').addClass('fa-angle-up'); 163 } 164 else{ 165 $this.children().removeClass('fa-angle-up').addClass('fa-angle-down'); 166 } 167 168 $this.parent().next().slideToggle( 'fast' ); 169 }); 170 171 // CLOSE MOBILE NAV 172 jQuery('#close-mobile-nav.header-1').on('click', function(){ 173 jQuery('body').removeClass('show-mobile-nav'); 174 }); 175 176 // EXPAND ROW HORIZONTALLY BEYOND PARENT CONTAINER 177 jQuery( window ).on( 'resize load', function(){ 178 jQuery('[data-behaviour="kl-full-width-stretched-row"]').each( function () { 179 180 const row = jQuery( this ); 181 const pageBody = jQuery('body'); 182 183 // RESET THE ROW MARGIN 184 row.css({ 'margin-left': 0,'margin-right': 0 }); 185 186 // CALCULATE THE LEFT AND RIGHT OFFSET 187 const leftMargin = row.offset().left - pageBody.offset().left;
188 const rightMargin = pageBody.outerWidth() - leftMargin - row.parent().outerWidth(); 189 190 // SET THE ROW MARGIN 191 row.css({ 'margin-left': - leftMargin + 'px', 'margin-right': - rightMargin + 'px' }); 192 193 } ); 194 195 } ).trigger('resize'); 196 197 // EXECUTED ON PAGE LOAD 198 fix_header(); 199 stickyHeader(); 200 201});
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.