1 在页面上首先设置如下两个div层
<div id="divMask" style="DISPLAY: none; Z-INDEX: 999; FILTER: alpha(opacity=50); LEFT: 0px; WIDTH: 1024px; POSITION: absolute; TOP: 0px; BACKGROUND-COLOR: silver; TEXT-ALIGN: center; opacity: 0.5; moz-opacity: 0.5"></div>
<div id="divPop" style="DISPLAY:none; Z-INDEX:1000; LEFT:400px; POSITION:absolute; TOP:350px" align="center"></div>
2 设置遮罩
window.parent.document.getElementById("divMask").style.height=window.parent.document.body.scrollHeight;
//显示遮罩
window.parent.document.getElementById("divMask").style.display = 'block';
window.parent.document.getElementById("divPop").style.display = 'block';
window.top.scrollTo(0,0);