页面用一个遮罩层显示加载,加载完后隐藏该div

<div id="background" class="background" style="display: none; "></div>
<div id="progressBar" class="progressBar" style="display: none; "><img src="/content/5-121204194109.gif"></div>   
.progressBar {
        display: block;
        width: 65px;
        height: 65px;
        top: 50%;
        left: 50%;
        margin-left: -74px;
        margin-top: -14px;
        padding: 10px;
        text-align: left;
        line-height: 27px;
        font-weight: bold;
        position: fixed;
        z-index: 2001;
    }

    .background {
        display: block;
        width: 100%;
        height: 100%;
        opacity: 0.4;
        filter: alpha(opacity=40);
        background: white;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 2000;
        background-color: #666666;
    }   
 var ajaxbg = $("#background, #progressBar");
        ajaxbg.hide();
        $(document).ajaxStart(function () {
            ajaxbg.show();
        }).ajaxStop(function () {
            ajaxbg.hide();
        });

猜你喜欢

转载自www.cnblogs.com/lunawzh/p/10226682.html