1// sticky 2jQuery(window).load(function(){ 3 var site_content_row = jQuery('.site-content-row')[0], 4 wp_adminBar = jQuery('#wpadminbar').outerHeight(), 5 sticky_navigation = jQuery('#sticky-navigation-bar').outerHeight(), 6 top_spacing = 20, 7 screenwidth = jQuery(window).outerWidth(); 8 9 if ( site_content_row ) { 10 var page_height = jQuery('body.theme-body').outerHeight(), 11 page_before_height = jQuery('body.theme-body').offset().top, 12 total_page_height = page_height + page_before_height, 13 before_content_height = jQuery('.site-content-row').offset().top, 14 content_height = jQuery('.site-content-row').outerHeight(), 15 after_height = total_page_height - before_content_height - content_height; 16 } 17 18 if (wp_adminBar || sticky_navigation) { 19 if (wp_adminBar && !sticky_navigation) { 20 top_spacing = top_spacing + wp_adminBar; 21 } 22 if (sticky_navigation && !wp_adminBar) { 23 top_spacing = top_spacing + sticky_navigation; 24 } 25 if (wp_adminBar && sticky_navigation) { 26 top_spacing = top_spacing + wp_adminBar + sticky_navigation; 27 } 28 } 29 if (screenwidth >= 992 ) { 30 jQuery(".sticky-sidebar").sticky({ topSpacing: top_spacing, bottomSpacing: after_height, }); 31 } 32 33 // For Sticky Navigation 34 var navbar_top_spacing = 0; 35 36 if (wp_adminBar && screenwidth >= 601) { 37 navbar_top_spacing = wp_adminBar; 38 } 39 // triggering sticky navigation 40 jQuery("#sticky-navigation-bar").sticky({ topSpacing: navbar_top_spacing, zIndex: 999}); 41 42 //event when loading, resizing and scrolling page 43 jQuery(window).on("load resize scroll",function(e){ 44 if (window.pageYOffset >= 1) { 45 var default_navbar = jQuery('#sticky-navigation-bar').outerHeight(), 46 responsive_navbar = jQuery('#sticky-navigation-bar .navigation-bar-top').outerHeight(), 47 screenheight = jQuery(window).outerHeight(), 48 screenwidth = jQuery(window).outerWidth(), 49 wp_adminBar = jQuery('#wpadminbar').outerHeight(), 50 active_sticky = jQuery('#sticky-navigation-bar').parent().hasClass('is-sticky'); 51 52 if (screenwidth >= 992) { 53 if (active_sticky) { 54 jQuery('#sticky-navigation-bar').parent('.is-sticky').css('padding-top', default_navbar); 55 } else { 56 jQuery('#sticky-navigation-bar').parent().css('padding-top', 0); 57 } 58 } else { 59 if (active_sticky) { 60 jQuery('#sticky-navigation-bar').parent('.is-sticky').css('padding-top', responsive_navbar); 61 } else { 62 jQuery('#sticky-navigation-bar').parent().css('padding-top', 0); 63 } 64 if (screenwidth <= 991) { 65 if (screenwidth >= 601 && wp_adminBar) { 66 responsive_navbar = responsive_navbar + wp_adminBar; 67 } 68 if (active_sticky) { 69 jQuery('#sticky-navigation-bar').parent('.is-sticky').find('.navbar-collapse').css('max-height', screenheight - responsive_navbar); 70 } 71 else { 72 jQuery('#sticky-navigation-bar').find('.navbar-collapse').css('max-height', 'none'); 73 } 74 } 75 } 76 } 77 }); 78});
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.