最简单点击弹出;点空白隐藏

2021年 1月 25日 1646点热度 0人点赞 0条评论

<script>
function locking() {
document.all.Layer.style.display = "block";
document.all.Layer.style.width = document.body.clientWidth;
document.all.Layer.style.height = document.body.clientHeight;
document.all.Layer2.style.display = 'block';
}
function Lock_CheckForm(theForm) {
document.all.Layer.style.display = 'none';
document.all.Layer2.style.display = 'none';
return false;
}
</script>

<div onClick="locking()">点我弹出</div>
<div id="Layer" onclick="Lock_CheckForm(this);" style="position: absolute; top: 0px; background-color: rgb(119, 119, 119); z-index: 7; left: 0px; display: none; width: 100%; height: 100%;opacity: 0.8;">
</div>
<div id="Layer2" align="center" style="position: absolute; z-index: 9; background-color: #fff; display: none;width: 70%;height: 200px; margin: 0 auto;position:fixed; position:fixed; left:0; right:0;border-radius: 9px;top:0; bottom:0; margin:auto;">

</div>

xinfa

这个人很懒,什么都没留下