Please disable your page from scrolling when you open a Modal window

Most of the web sites uses Modal windows to interact with their users, calling for an action. while the modal window is open, you can still scroll the page under the modal, what happen if your modal are scrollable too? you get a double scroll, one of the most annoying symptom on the web.

Here I’m going to show you a simple way to block the body from keep scrolling when a modal window is open.

ADHD Helpers module

Use the module

Now, in your code, you can use this module like the following example:

...showing a modal window...
...user close the modal...
Like what you read? Give The Client Side of the Moon a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.