2 ms·
"If you want to prevent the background page from scrolling (see demo for example) you must wrap the page contents in a <div class="page-container">. The reason
by atirip 14y ago
"If you want to prevent the background page from scrolling (see demo for example) you must wrap the page contents in a <div class="page-container">.
The reason for doing this instead of just simply setting overflow: hidden when a modal is open is to avoid having the page shift as a result of the scrollbar appearing/disappearing."
There's a solution available which avoids wrap and page shift too. Take a look at: https://github.com/atirip/bodyscrollkiller.js https://github.com/atirip/bodyscrollkiller.js