html5 自定义遮罩

发布时间:2020-10-09 18:07:07 作者:antlove
来源:网络 阅读:1678

ys_loading.css

.ys-loading{
    position:fixed;
    top:0;
    bottom:0;
    left:0;
    right:0;
    z-index: 9999;
}

.ys-loading em{
    position:absolute;
    left:0;
    right:0;
    top:0;
    bottom:0;
    width:44px;
    height:44px;
    margin:auto;
    border-radius: 22px;
    opacity: 0.3;
    overflow: hidden;
}

.ys-loading em:before{
    content:"";
    display:block;
    width:46px;
    height:46px;
    background:url(../../p_w_picpaths/common/ajax-loader.gif) no-repeat center center;
    background-size:contain;
    margin-top:-1px;
    margin-left:-1px;
}

ys_loading.js

(function($){

    var container = null;

    var html =  "<div class='ys-loading'><em></em></div>";

    function render(){
        container = $(html).appendTo("body");
    }
    var initialized = false;
    function init(){
        if(initialized){
            return;
        }
        initialized = true;
        render();
    }

    var LoadingWidget = {
        showLoading:function(){
            init();
            container.show();
        },
        hideLoading:function(){
            container.hide();
        }
    };

    window.LoadingWidget = LoadingWidget;
})(jQuery);

html5 自定义遮罩

推荐阅读:
  1. HTML5中dialog元素的示例
  2. html5 canvas和JavaScript怎么实现本地截图

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

html web css

上一篇:怎么查看mysql文件储存在哪里

下一篇:mysql增加int字段的方法

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》