On the mobile phone page, the default body content is a lot, with scroll bars. When a pop-up layer appears when clicked, the body content cannot be scrolled, but the pop-up layer can be scrolled! How to deal with it?
ringa_lee2017-05-18 11:02:54
It seems that there is no need to set anything separately. When the pop-up layer appears, set the original content to overflow and hide, the pop-up layer will overflow automatically, and the opposite will be true when closing it
大家讲道理2017-05-18 11:02:54
You can prevent bubbling in the scroll event of the popup layerevent.stopPropagation()
. Then when scrolling the pop-up layer, the external scroll event will not be triggered.
$(".pop_box").on("touchmove",function(event){
event.stopPropagation()
})
習慣沉默2017-05-18 11:02:54
You can try the modal box of bootstrap. It seems that the pop-up layer of the modal box can be scrolled, but the body cannot.
PHP中文网2017-05-18 11:02:54
Set the width and height of the body to 100% and overflow: hidden; the popup layer overflow: auto; should be fine