html5自定义遮罩的实现代码分享
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(../../images/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自定义遮罩的实现代码分享的详细内容,更多请关注php中文网其它相关文章!
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号