遮罩的使用

页面Div:

<div class="first">
            <!-- 弹出窗口 -->
            <div id="fullbg"></div>
            <div id="dialog">
                <p class="close"><a href="javascript:void(0);" id="close">关闭</a></p>
                <div style="margin-left: 30px;margin-right: 30px">
                    <table style="font-size: 18px;color: black;">
                        <tr>
                            <td style="text-align:center" align="center" >
                           
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>

CSS:

.first{

    _display: inline;
    float: left;
    margin-right: 10px;
    overflow: hidden;

    950px;
    margin-right: 0px;
    margin-bottom: 5px;
}

.close {
text-align:right;
padding-right:10px;
}

JS:

function showBg() {
            $("#fullbg").css({
                height:$(document).height(),
                $(document).width(),
                display:"block"
            });
            $("#dialog").show();
        };
        
        $("#close").click(
                // 弹出支付验证窗口
                function() {
                    $("#fullbg").css({
                        height:$(document).height(),
                        $(document).width(),
                        display:"none"
                    });
                    $("#dialog").hide();
                });

原文地址:https://www.cnblogs.com/wangkang0320/p/6508567.html