Skip to content

Commit

Permalink
fix hamburger scroll to top on click
Browse files Browse the repository at this point in the history
  • Loading branch information
luukee committed Sep 5, 2024
1 parent a690af7 commit 2e3e694
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
console.log("object")
checkbox.removeAttribute("checked")
}

// Event listener for clicks on the toggle button (hamburger)
toggle.addEventListener("click", function (e) {
e.preventDefault() // Prevents the default scrolling behavior
checkbox.checked = !checkbox.checked // Toggle the checkbox state
})

document.addEventListener(
"click",
function (e) {
Expand Down

0 comments on commit 2e3e694

Please sign in to comment.