<div class="codetitle"> <span><a style="CURSOR: pointer" data="50437" class="copybut" id="copybut50437" onclick="doCopy('code50437')"><u>复代码</u></a></span> 代码如下:</div> <div class="codebody" id="code50437"> <br>//实现局부遮罩 <br><script type=" 텍스트/자바스크립트"> <br>function Shade(){ <br>var s = document.getElementById("shade"); <br>s.style.display = "차단"; <br>} <br>function Display(){ <br>var d = document.getElementById("shade"); <br>d.style.display = "없음"; <br>} <br></script> <br><style type="text/css"> <br>#상자{ <br>너비:400px; <br>높이:300px; <br>위치:상대적; <br>여백:0px 자동; <br>테두리:1px 솔리드 #000; <br>} <br>#shade{ <br>너비:400px; <br>높이:300px; <br>배경색:회색; <br>위치:절대; <br>z-색인:999; <br>왼쪽:0px; <br>상단:0px; <br>-moz-opacity:0.5;/*Firefox*/ <br>불투명도:0.5;/*Opera*/ <br>filter:alpha(opacity=50); /*IE*/ <br>} <br></style> <br></head> <br><br><본문> <br><div id = "box"> <br><a href = "javascript:Shade()">局part遮罩</a> <br><div id = "shade"></div> <br></div> <br><a href = "javascript:Display()">遮罩消失</a> <br></body> <br> </div>