Home > Blockchain >  How to disable back screen scrolling when popup is displayed
How to disable back screen scrolling when popup is displayed

Time:05-10

I am using this popup modal from https://www.w3schools.com/bootstrap/bootstrap_modal.asp, and it works pretty well, the issue is that when the popup appears, the back screen is still scrollable, which i can not figure out how to resolve

CodePudding user response:

When the modal is open you can set some CSS class for your html and body elements. For example: .modal-open.

.modal-open {
    overflow: hidden;
}

More here: https://stackoverflow.com/a/53932629/8890700

  • Related