H
H
htmlclassic2022-02-19 17:49:58
css
htmlclassic, 2022-02-19 17:49:58

How to prevent scrolling of the page when the fixed menu is expanded to full screen?

Hello.

You can open the menu on your mobile phone. The menu opens in full screen and the menu is fixed.
Well, while this menu is open, I can scroll the entire page with the wheel.

How to completely disable page scrolling when the menu is open?

It turns out like this: I scrolled to the middle of the page, open the menu, scroll again, close the menu and I'm no longer in the middle of the page, but somewhere else.

Here is an example where the fixed element is on top of the content, and the content itself is scrollable.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kentavr16, 2022-02-19
@htmlclassic

https://codepen.io/kentavr16/pen/OJOvPKw

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question