码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2019-01-05 23:21:43      阅读:362      评论:0      收藏:0      [点我收藏+]

标签:var   UNC   style   img   Fix   block   doc   .ajax   pre   

<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();
        });

 

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

标签:var   UNC   style   img   Fix   block   doc   .ajax   pre   

原文地址:https://www.cnblogs.com/lunawzh/p/10226682.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!