D
D
Daniil Kasyanov2020-04-21 22:32:13
css
Daniil Kasyanov, 2020-04-21 22:32:13

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

1 answer(s)
R
ReActor Dmitry Vershansky, 2020-04-21
@Kasyanova10

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 question

Ask a Question

731 491 924 answers to any question