Make menu more accessible

This commit is contained in:
Joe Hutchinson
2019-01-03 10:40:57 -05:00
parent ce2d266fc2
commit 26e4dbfa7a
3 changed files with 39 additions and 34 deletions

View File

@@ -9,12 +9,16 @@ function cardReleased() {
}
function hamburgerMenuPressed() {
if (document.body.classList.contains('no-scroll')) {
if (this.parentNode.classList.contains('hamburger-menu-open')) {
document.body.classList.remove('no-scroll');
this.parentNode.classList.remove('hamburger-menu-open')
this.setAttribute('aria-expanded', "false");
document.body.style.paddingRight = 0 + "px";
} else {
document.body.style.paddingRight = window.innerWidth - document.documentElement.clientWidth + "px";
document.body.classList.add('no-scroll');
this.parentNode.classList.add('hamburger-menu-open')
this.setAttribute('aria-expanded', "true");
}
}