1jQuery(function($){ 2 3 "use strict"; 4 5 6 /* Match height for portfolio archive entry. 7 --------------------------------------------- */ 8 $( '.genesis-pro-portfolio .entry' ).matchHeight(); 9 10 11 /* Sticky Header 12 --------------------------------------------- */ 13 function kreativ_sticky_header() { 14 var header = $('.site-header'), 15 body = $('body'), 16 wrap = header.find('.wrap').first(), 17 spacer = $('<div />', { 18 'class': 'header-spacer', 19 }); 20 21 if(!body.hasClass('sticky-header-active')) { 22 return; 23 } 24 25 if (header.length) { 26 $(window).scroll(function () { 27 if ( window.innerWidth > 1024 ) { 28 29 var spacerHeight = header.outerHeight(), 30 scrolltop = $(window).scrollTop(); 31 32 // Get admin bar height 33 if(body.hasClass('admin-bar')) { 34 scrolltop = scrolltop + 32; 35 } 36 37 // Set the spacer height 38 spacer.height(spacerHeight); 39 40 // Set sticky header 41 if (!header.hasClass('sticky') && scrolltop > header.offset().top) { 42 // Add spacer before header 43 header.before(spacer); 44 // Add sticky class to header 45 header.addClass('sticky'); 46 } 47 48 // Unset sticky header 49 else if (header.hasClass('sticky') && ( scrolltop < spacer.offset().top || scrolltop == 0 ) ) { 50 // Remove spacer 51 spacer.remove(); 52 // Remove sticky class from header 53 header.removeClass('sticky'); 54 } 55 } 56 }); 57 } 58 59 //* Remove sticky header styles 60 $(window).resize(function(){ 61 if ( window.innerWidth < 1024 ) { 62 if(header.hasClass('sticky')) { 63 header.removeClass('sticky'); 64 } 65 if (spacer.size()) { 66 spacer.remove(); 67 } 68 } 69 }); 70 } 71 72 //* Init sticky header 73 kreativ_sticky_header(); 74 75 76 /* Scroll to top 77 --------------------------------------------- */ 78 function kreativ_scroll_top() { 79 // Toggle scrollup icon 80 var scrollup = $('.scrollup'); 81 $(window).scroll(function(){ 82 if ($(this).scrollTop() > 100) { 83 // Show scrollup button 84 scrollup.fadeIn(); 85 } else { 86 // Hide scrollup button 87 scrollup.fadeOut(); 88 } 89 }); 90 91 // Init scroll to top 92 scrollup.click(function(){ 93 $("html, body").animate({ scrollTop: 0 }, 600); 94 return false; 95 }); 96 } 97 98 //* Init scroll top 99 kreativ_scroll_top(); 100 101});
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.