Fix navbar handling

This commit is contained in:
mark
2023-05-08 17:03:08 +02:00
parent ef3d79f875
commit fda4efa72b

View File

@@ -2,6 +2,7 @@ const navbar = document.querySelector('.navbar')
const toggler = document.getElementById('main-nav-toggler')
const modeSelectors = document.querySelectorAll('.switch-mode-collapsed')
if (navbar !== null && toggler !== null) {
// set the navbar background color to opaque when scrolling past a breakpoint
window.onscroll = () => {
if (window.scrollY > 75) {
@@ -22,3 +23,4 @@ for (let i = 0; i < modeSelectors.length; ++i) {
toggler.click()
}
}
}