mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-18 15:33:10 +00:00
Fix navbar handling
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user