• 等待层


            /**
             * 等待层
             */
            setWaitPanel:function(){
                if(document.getElementById("loader_container")!=null){
                    return;
                }
                
                var sWidth = document.body.offsetWidth;
                var sHeight = document.body.scrollHeight;
                panel = document.createElement("div");
                panel.setAttribute('id', 'bgDiv');
                panel.setAttribute('class', 'msgCover');
                panel.style.width = sWidth + "px";
                panel.style.height = sHeight + "px";
                document.body.appendChild(panel);
                
                obj1 = document.createElement("div");
                obj1.setAttribute("id","loader_container");
                
                var obj2 = document.createElement("div");
                obj2.setAttribute("id", "loader");
                document.body.appendChild(obj1);
                document.getElementById("loader_container").appendChild(obj2);
                
                var obj3 = document.createElement("div");
                obj3.setAttribute("id","load_img");
                document.getElementById("loader").appendChild(obj3);
                
                var obj4 = document.createElement("div");
                obj4.setAttribute("id","load_msg");
                obj4.innerHTML = "载入中...";
                document.getElementById("loader").appendChild(obj4);
            },
            
            /**
             * 清除等待层
             */
            clearWaitPanel:function(){
                document.body.removeChild(panel); 
                document.body.removeChild(obj1);
            }
        };
    =================================
    提交时设置等待层,显示数据后清除等待层
    .msgCover {
        background: none repeat scroll 0 0 #777;
        opacity: 0.65;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 10000;
    }
    #loader_container {
        text-align: center;
        position: absolute;
        top: 200px;
         100%;
        left: 0;
        z-index: 10001;
    }
    #loader {
        font-size: 11.5px;
        background-color: #FFFFFF;
        padding: 10px 0;
        margin: 0 auto;
        height: 18px;
         120px;
        border: 1px solid #5a667b;
        z-index: 2;
        -moz-border-radius: 5px;
        -webkit-border-radius: 5px;
    }
    
    #load_img {
        background-image: url("../images/wait.gif");
        background-size: 16px 16px;
        background-repeat: no-repeat;
        float: left;
        height: 22px;
        margin: 2px 0 0 10px;
         23px;
    }
    
    #load_msg {
        float: left;
        margin: 3px 0;
    }
    
    ============用法=============
    提交后设置等待层    SA.setWaitPanel();
    数据响应返回后清除等待层    SA.clearWaitPanel();

     

  • 相关阅读:
    Ado.net 02
    Ado.net01
    sql05
    sql04
    sql03
    sql02
    sql01
    czC#02
    czC#02
    Vue之render函数
  • 原文地址:https://www.cnblogs.com/yunmengxiaohe/p/4256155.html
Copyright © 2020-2023  润新知