Skip to content

Commit

Permalink
[js]: if hamburger checkbox is already checked, prevent scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
cszach committed Oct 15, 2023
1 parent a894d5b commit 60bc24f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ document.addEventListener('DOMContentLoaded', () => {
const navigationLinks = navBar.querySelectorAll('li');
const hamburgerCheckbox = navBar.querySelector('.peer');

if (hamburgerCheckbox.checked) {
document.body.classList.add('overflow-hidden');
}

// Hamburger navigation

navigationLinks.forEach(navigationLink => {
Expand Down

0 comments on commit 60bc24f

Please sign in to comment.