1/*! 2* Start Bootstrap - Clean Blog v6.0.9 (https://startbootstrap.com/theme/clean-blog) 3* Copyright 2013-2023 Start Bootstrap 4* Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-clean-blog/blob/master/LICENSE) 5*/ 6window.addEventListener('DOMContentLoaded', () => { 7 let scrollPos = 0; 8 const mainNav = document.getElementById('mainNav'); 9 const headerHeight = mainNav.clientHeight; 10 window.addEventListener('scroll', function() { 11 const currentTop = document.body.getBoundingClientRect().top * -1; 12 if ( currentTop < scrollPos) { 13 // Scrolling Up 14 if (currentTop > 0 && mainNav.classList.contains('is-fixed')) { 15 mainNav.classList.add('is-visible'); 16 } else { 17 console.log(123); 18 mainNav.classList.remove('is-visible', 'is-fixed'); 19 } 20 } else { 21 // Scrolling Down 22 mainNav.classList.remove(['is-visible']); 23 if (currentTop > headerHeight && !mainNav.classList.contains('is-fixed')) { 24 mainNav.classList.add('is-fixed'); 25 } 26 } 27 scrollPos = currentTop; 28 }); 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.