1jQuery(document).ready(function($){ 2 3 var orginal_height = typeof(orginal_height==='undefined') || $('body').hasClass('fixed_sticky_active')==false ? $('#site-logo-inner').height() : orginal_height; 4 5 function sticky_header_oceanwp(){ 6 7 var style = typeof(sticky_header_style) !== 'undefined' && sticky_header_style == 'shrink' ? 'shrink' : 'float'; 8 var site_header = $('#site-header'); 9 var wpadmin_height = $('#wpadminbar').css('position') == 'fixed' && $('#wpadminbar').height() > 0 ? $('#wpadminbar').height() : 0; 10 var top_bars = $('#wpadminbar').css('position') == 'fixed' ? $('#top-bar-wrap').height() : $('#top-bar-wrap').height() + $('#wpadminbar').height(); 11 if (Number.isNaN(top_bars)){ 12 top_bars = $('#top-bar-wrap').height(); 13 } 14 top_bars = top_bars || 0; 15 var header_status = $(window).scrollTop() >= top_bars; 16 var header_padding = site_header.height(); 17 18 if (style == 'float'){ 19 20 if (!header_status){ 21 site_header.css({ 22 'position': 'relative', 23 'top': '0', 24 }); 25 site_header.next().css('margin-top', '0'); 26 }else{ 27 site_header.css({ 28 'position': 'fixed', 29 'top': wpadmin_height, 30 'width': '100%', 31 'z-index': '998', 32 }); 33 site_header.next().css('margin-top', header_padding); 34 } 35 } 36 37 if (style == 'shrink'){ 38 39 if (!header_status){ 40 site_header.css({ 41 'position': 'relative', 42 'top': '0', 43 }); 44 $('body').removeClass('fixed_sticky_active'); 45 site_header.next().css('margin-top', '0'); 46 }else{ 47 site_header.css({ 48 'position': 'fixed', 49 'top': wpadmin_height, 50 'width': '100%', 51 'z-index': '998', 52 }); 53 site_header.next().css('margin-top', header_padding); 54 $('body').addClass('fixed_sticky_active'); 55 } 56 } 57 58 } 59 60 $(window).resize(function(){ 61 $('body').removeClass('fixed_sticky_active'); 62 sticky_header_oceanwp(); 63 }); 64 65 $(window).scroll(function(){ 66 sticky_header_oceanwp(); 67 }); 68 69 sticky_header_oceanwp(); 70 71 72});
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.