Skip to content

Commit

Permalink
disabled touch scroll with menu open
Browse files Browse the repository at this point in the history
  • Loading branch information
MattRowe18 committed Mar 19, 2024
1 parent 5085c2a commit bed6eef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ section:last-child {
}
}

.disable-touch {
touch-action: none;
}

a {
font-weight: bold;
color: #4b4b4b;
Expand Down
7 changes: 4 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1083,9 +1083,6 @@ <h2 class="text-left" style="color:white;display:inline;margin-right:2em;"><stro

// document.body.addEventListener('touchstart', handleTouchStart)
// document.body.addEventListener('touchend', handleTouchEnd)
// document.body.addEventListener('touchmove', handleTouchMove)



// ************************************************ NAV

Expand All @@ -1106,6 +1103,8 @@ <h2 class="text-left" style="color:white;display:inline;margin-right:2em;"><stro
toggleParent.replaceChild(newToggle, toggle)
newToggle.addEventListener("click", toggleMenu, false);
toggle = newToggle;
scrollLock = false;
document.body.classList.remove('disable-touch')
}
function addX() {
menu.classList.add("active");
Expand All @@ -1116,6 +1115,8 @@ <h2 class="text-left" style="color:white;display:inline;margin-right:2em;"><stro
toggleParent.replaceChild(newToggle, toggle)
newToggle.addEventListener("click", toggleMenu, false);
toggle = newToggle;
scrollLock = true;
document.body.classList.add('disable-touch')
}

function toggleMenu() {
Expand Down

0 comments on commit bed6eef

Please sign in to comment.