Please solve the problem so that when scrolling the site, the menu bar decreases in size?
-
JavaScript Anonymous, May 16, 2019
-
document.addEventListener(`scroll`, () => {
if (window.pageYOffset > 0) {
navbar.classList.add(`menu-not-top`);
}
});Anonymous
1 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!