美文网首页
数据加载loading...

数据加载loading...

作者: black白先森 | 来源:发表于2016-09-26 20:32 被阅读40次
    /*-------------- 数据点加载小动画   --------------*/
    .loader-container{
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    .loader-wrap {
        position: absolute;
        top: 50%;
        left: 50%;
        -webkit-transform: translate(-50%, -50%);
        transform: translate(-50%, -50%);
        text-align: center;
        display: block;
        vertical-align: middle;
    }
    
    .loader-wrap>span {
        display: inline-block;
        width: 16px;
        height: 16px;
        background-color: #3bb4f2;
        -webkit-animation: amt-bouncedelay 1.4s infinite ease-in-out both;
        animation: amt-bouncedelay 1.4s infinite ease-in-out both;
        -webkit-border-radius: 100%;
        border-radius: 100%;
        -webkit-transform-style: preserve-3d;
        -webkit-backface-visibility: hidden;
    }
    
    .loader-wrap>span+span {
        margin-left: 5px
    }
    
    .loader-wrap .loader-bounce1 {
        -webkit-animation-delay: -.32s;
        animation-delay: -.32s
    }
    
    .loader-wrap .loader-bounce2 {
        -webkit-animation-delay: -.16s;
        animation-delay: -.16s
    }
    
    @-webkit-keyframes amt-bouncedelay {
        0%,80%,to {
            -webkit-transform: scale(0);
            transform: scale(0)
        }
    
        40% {
            -webkit-transform: scale(1);
            transform: scale(1)
        }
    }
    
    @keyframes amt-bouncedelay {
        0%,80%,to {
            -webkit-transform: scale(0);
            transform: scale(0)
        }
    
        40% {
            -webkit-transform: scale(1);
            transform: scale(1)
        }
    }
    
    // 小圆点交叉加载动画
        $.dotLoading = function(type) {
            var _type = type || "show";
            var html_tpl = '<div class="loader-container" id="loader_container">' + 
                                '<div class="loader-wrap">' + 
                                    '<span class="loader-bounce1"></span>'+
                                    '<span class="loader-bounce2"></span>'+
                                    '<span class="loader-bounce3"></span>'+
                                '</div>'+
                            '</div>';
            
            // 显示加载;
            $(".loader-container").remove();
            if(_type == "show"){
                $("body").append(html_tpl);
            }
            // 禁止滑动
            $("body").on("touchmove", "#loader_container",function(event){
                event.preventDefault();
                event.stopPropagation();
                return false;
            });
        };
    

    相关文章

      网友评论

          本文标题:数据加载loading...

          本文链接:https://www.haomeiwen.com/subject/whozettx.html