<div style="width: 100%;height:2000px;">
<button style="margin-top: 200px;" onclick="show()">sssssss</button>
</div>
<div id="model" style="position: absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.3)">
<button onclick="hide()">eeeee</button>
</div>
#model{
display: none;
}
function show(){
let model = document.getElementById("model")
let top = $(document).scrollTop()
model.style.top = top+"px"
model.style.display = "block"
scollchange(top)
}
function hide(){
let model = document.getElementById("model")
model.style.display = "none"
$(document).unbind()
}
function scollchange(top){
$(document).on('scroll.unable',function (e) {
$(document).scrollTop(top);
})
}
本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。