ホームページ > ウェブフロントエンド > htmlチュートリアル > 表示領域をロックするにはどうすればよいですか? _html/css_WEB-ITnose

表示領域をロックするにはどうすればよいですか? _html/css_WEB-ITnose

WBOY
リリース: 2016-06-21 08:59:11
オリジナル
1207 人が閲覧しました





全屏div

<script> <br> <br>function shield(){ <br>    var s = document.getElementById("test"); <br>    s.style.display = "block"; <br>     <br>    var l = document.getElementById("log_window"); <br>    l.style.display = "block"; <br>} <br>function cancel_shield(){ <br>    var s = document.getElementById("test"); <br>    s.style.display = "none"; <br>     <br>    var l = document.getElementById("log_window"); <br>    l.style.display = "none"; <br>} <br></script>




打开遮罩
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




关闭





点击打开遮罩時,可視区变色并および锁定,滚动条不可下拉


回复讨论(解决方案)

<!DOCTYPE html><html><head><meta charset="utf-8"><title>全屏div</title><style>html,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;}</style><script>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";}</script></head><body id="body"><a href="javascript:shield()">打开遮罩</a>点击打开遮罩时,可视区变色并且锁定,滚动条不能下拉<div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div>aaa</div><div id="test"></div><div id="log_window"><a href="javascript:cancel_shield()">关闭</a></div></body></html>
ログイン後にコピー

関連ラベル:
ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート