Skip to content

Commit

Permalink
remove scroll when menu is opened
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisGurskiy committed Mar 7, 2024
1 parent 5b78158 commit cae9cfc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/scripts/main.js
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
'use strict';

window.addEventListener('hashchange', () => {
const targetId = window.location.hash.substring(1);

if (targetId === 'menu') {
document.body.classList.add('page__body--menu--open');
} else {
document.body.classList.remove('page__body--menu--open');
}
});
2 changes: 2 additions & 0 deletions src/styles/blocks/page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

&--menu--open {
overflow: hidden;

// height: 100vh;
}
}

Expand Down

0 comments on commit cae9cfc

Please sign in to comment.