E
E
Eithenhard2019-04-25 09:53:12
Layout
Eithenhard, 2019-04-25 09:53:12

How to block scrolling on mobile?

Good day, the question is. There is a dropdown menu, quite large. The problem is that when you open it, it goes down, the sticky-top panel, so when you try to scroll the menu, the body scrolls first, and then the menu. Here's how to fix it so that when the menu is opened, the body does not scroll, but the menu scrolls right away. Accordingly, when the menu was closed, this parameter was removed. Something no ideas (

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dima Pautov, 2019-04-25
@bootd

Give the menu itself a scroll and limit its maximum height

I
inkShio, 2019-04-25
@inkShio

When opening a dropdown, add a class to body or html
.mobile-scroll-hide {
overflow: hidden;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question