1jQuery(document).ready(function ($) { 2 var header = document.getElementById("main-navigation-bar"); 3 var masthead = document.getElementById("masthead"); 4 5 if (!header || !masthead) return; 6 7 var stickyHeight = header.offsetHeight; 8 var sticky = header.offsetTop + stickyHeight; 9 var isStickyActive = false; 10 11 function applyStickyHeader() { 12 if (window.pageYOffset > sticky) { 13 if (!isStickyActive) { 14 header.classList.add("aft-sticky-navigation"); 15 masthead.style.paddingBottom = stickyHeight + "px"; 16 isStickyActive = true; 17 } 18 } else { 19 if (isStickyActive) { 20 header.classList.remove("aft-sticky-navigation"); 21 masthead.style.paddingBottom = "0px"; 22 isStickyActive = false; 23 } 24 } 25 } 26 27 $(window).on('scroll', applyStickyHeader); 28 applyStickyHeader(); // Run on load 29});
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.