twitter bootstrap 3 modal on mobile scroll issues

2020-02-08 01:32发布

I am currently using twitter bootstrap 3 modal on mobile. It works perfectly fine on desktop, however on mobile whenever I scroll it also scrolls the window behind the modal. How do I prevent this from happening?

7条回答
Summer. ? 凉城
2楼-- · 2020-02-08 02:21

Interestingly enough, they address this in the docs without offering much in the way of a solution:

"Support for overflow: hidden on the <body> element is quite limited in iOS and Android. To that end, when you scroll past the top or bottom of a modal in either of those devices' browsers, the <body> content will begin to scroll."

http://getbootstrap.com/getting-started/#overflow-and-scrolling

查看更多
登录 后发表回答