Today I ran into a situation where I opened two modals at the same time. I was able to successfully close the top modal, however, when I went back to focus on the previous modal, the scroll would not work and instead it would scroll the background page, not the modal. After some investigation, I found a way to use javascript, css by using jquery. this is the jquery I used after the first modal was closed:


It worked perfect. This is the CSS you can use.

.modal {

Hope that works,

Credit to: