M
M
mousesport2020-09-09 16:03:41
css
mousesport, 2020-09-09 16:03:41

The menu won't scroll on the mobile version of the site?

Hello, tell me how to fix it so that in the mobile version of the site , when you open the menu, the menu subsections scroll, and not the entire page, which until you scroll through the menu does not start to scroll.

-tried to hang a jquery handler so that when the menu is opened, the body {overflow: hidden;} style is added, but the scrolling is removed from the entire page and the menu does not scroll.
-tried jquery handler to hide extra divs when menu is opened display:none, but it's inconvenient, because it doesn't save the page position at the time of menu opening, if you
close the menu back you have to flip the page again to the place where you opened the menu.
-tried to hang a jquery handler so that when the menu is opened, the body.fix {position: fixed;} style is added, but the menu and the page itself stop scrolling.
Google search has already turned over ...

Help comrades with advice ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2020-09-09
@mousesport

Try like this

.header__nav {
    margin: -10px;
    padding: 12px 0 0;

    max-height: calc(100vh - 142px);
    overflow-y: auto;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question