怎么锁定可视区域?_html/css_WEB-ITnose

nbsp;html>

全屏div

html,body {
margin:0;
height:100%;
}
#test {
width:100%;
height:100%;
background-color:#000;
position:absolute;
top:0;
left:0;
z-index:2;
opacity:0.3;
/*兼容ie8及以下版本浏览器*/
filter: alpha(opacity=30);
display:none;
overflow-y:hidden;
}

#log_window {
width:200px;
height:200px;
background-color:#ff0;
margin: auto;
position: absolute;
z-index:3;
top: 0;
bottom: 0;
left: 0;
right: 0;
display:none;
}

function shield(){
var s = document.getelementbyid(“test”);
s.style.display = “block”;

var l = document.getelementbyid(“log_window”);
l.style.display = “block”;
}
function cancel_shield(){
var s = document.getelementbyid(“test”);
s.style.display = “none”;

var l = document.getelementbyid(“log_window”);
l.style.display = “none”;
}

打开遮罩
aaa
aaaaaa
aaaaaa
aaa
aaa
aaa
aaaaaaaaa
aaa
aaa
aaa
aaa
aaaaaa
aaaaaa
aaa
aaa
aaa
aaaaaaaaa
aaa
aaa
aaa
aaa
aaaaaa
aaaaaa
aaa
aaa
aaa
aaaaaaaaa
aaa
aaa
aaa
aaa
aaaaaa
aaaaaa
aaa
aaa
aaa
aaaaaaaaa
aaa
aaa
aaa
aaa
aaaaaa
aaaaaa
aaa
aaa
aaa
aaaaaaaaa
aaa
aaa
aaa
aaa
aaaaaa
aaaaaa
aaa
aaa
aaa
aaaaaaaaa
aaa
aaa
aaa
aaa
aaaaaa
aaaaaa
aaa
aaa
aaa
aaaaaaaaa
aaa
aaa
aaa
aaa
aaaaaa
aaaaaa
aaa
aaa
aaa
aaaaaaaaa
aaa
aaa
aaa
aaa
aaaaaa
aaaaaa
aaa
aaa
aaa
aaaaaaaaa
aaa
aaa
aaa
aaa
aaaaaa
aaaaaa
aaa
aaa
aaa
aaaaaaaaa
aaa
aaa
aaa
aaa
aaaaaa
aaaaaa
aaa
aaa
aaa
aaaaaaaaa
aaa
aaa
aaa
aaa
aaaaaa
aaaaaa
aaa
aaa
aaa
aaaaaaaaa
aaa
aaa
aaa
aaa
aaaaaa
aaaaaa
aaa
aaa
aaa
aaaaaaaaa
aaa
aaa
aaa
aaa
aaaaaa
aaaaaa
aaa
aaa
aaa
aaaaaaaaa
aaa
aaa
aaa
aaa
aaaaaa
aaaaaa
aaa
aaa
aaa
aaaaaaaaa
aaa
aaa
aaa
aaa
aaaaaa
aaaaaa
aaa
aaa
aaa
aaaaaaaaa
aaa
aaa
aaa
aaa
aaaaaa
aaaaaa
aaa
aaa
aaa
aaaaaaaaa
aaa
aaa
aaa
aaa

打开遮罩

点击打开遮罩时,可视区变色并且锁定,滚动条不能下拉

回复讨论(解决方案)

nbsp;html>全屏divhtml,body {    margin:0;    height:100%;}#test {    width:100%;    height:100%;    background-color:#000;    position:fixed;    top:0;    left:0;    z-index:2;    opacity:0.3;    /*兼容IE8及以下版本浏览器*/    filter: alpha(opacity=30);    display:none;overflow-y:hidden;}#log_window {    width:200px;    height:200px;    background-color:#FF0;        margin: auto;    position:fixed;    z-index:3;    top: 0;    bottom: 0;    left: 0;    right: 0;    display:none;}function shield(){    var s = document.getElementById("test");    s.style.display = "block";        var l = document.getElementById("log_window");    l.style.display = "block";document.getElementById("body").style.overflowY = "hidden";}function cancel_shield(){    var s = document.getElementById("test");    s.style.display = "none";        var l = document.getElementById("log_window");    l.style.display = "none";document.getElementById("body").style.overflowY = "auto";}打开遮罩点击打开遮罩时,可视区变色并且锁定,滚动条不能下拉
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa
aaa

登录后复制

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。

发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/3115925.html

(0)
上一篇 2025年3月29日 12:54:21
下一篇 2025年3月29日 12:54:36

AD推荐 黄金广告位招租... 更多推荐

发表回复

登录后才能评论