数据加载完成之前,显示动态的加载图片

CSS样式 

#loading{
          width: 100%;
          height: 100%;
          background-color: #ffffff;
          position: fixed;
          top:0;
          left: 0;
          z-index: 9999;
        }
        #loading >i{
          width: 64px;
          height: 64px;
          position: absolute;
          top:0;
          bottom:0;
          left:0;
          right: 0;
          margin: auto;
          background: url("") no-repeat;
        } 

JS代码

document.onreadystatechange = function () {
            if (document.readyState === "complete") {
                $(document).ajaxStop(function () {
                    $("#loading").fadeOut();
                });
            }
        }

html页面就省略了 ,

猜你喜欢

转载自blog.csdn.net/zcq125521/article/details/88397740