参考示例
默认状态(打开)
$.mask();
默认状态(关闭)
$.unmask();
设置样式参数
$.mask({
background:"#2932E1",
zIndex:9999,
opacity:0.7
});
直接删除
$.unmask("fast");
删除动画过渡时间
$.unmask(2000);
删除所有遮罩层
$.unmask(true,2000); // 第一个参数设置成 true
mask 函数 before,callback
$.mask({
background:"#FEB20F",
zIndex:9999,
opacity:0.8,
before:function(r){
alert("将会生成的遮罩层id:" + r);
},
callback:function(r){
alert("已经生成的遮罩层id:" + r);
}
});
unmask 函数
$.mask(function(){
});
参数及其说明
$.extend({
/**
* mask 生成遮罩层
* @param {[Object]} optss [description]
* @return {[type]} [description]
*/
mask:function(optss){
// ...
},
/**
* unmask:: 删除 遮罩层
*
* @arguments {[Boolean]} a [description]
* @param {[Boolean]} b [description]
*
*/
unmask:function(a,b){ // (ture,300);
// ...
}
// default optss
$.mask.defaults = {
background:"#000",
zIndex:9999,
opacity:0.5,
before: function(a) {},
callback: function(a) {}
};
})