Answer the question
In order to leave comments, you need to log in
How to make a modal window with a scroll?
Good afternoon. Please tell me how can I implement such a modal window, which will scroll when opened. There will be some kind of article in the modal window, with text and pictures (the customer does not want to put this on a new page). It is important that the window opens at a certain distance from the top of the screen, regardless of where the user is on the site. And it is also important that when the window is opened, the scroll of the main page is disabled, because. the user will scroll the window.
I know that I should have googled, and not asked questions on Habré, but everything is not right on Google ((((
Maybe someone has a link to what I need?
Thank you very much
Answer the question
In order to leave comments, you need to log in
Hello!
Key points:
1. Layout the popup-window using fixed positioning (fixed)
2. Set the height parameter of this window (height)
3. Set the property (overfoiw), with the value (auto)
4. Apply the same overscroll-behavior property, with set to contain to prevent the scrollbar from being hijacked by a non-target element.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question