layer 弹出层 确定按钮节流

This commit is contained in:
Theluyuan 2023-02-20 11:48:16 +08:00
parent 2458e523ba
commit 096ee2fc96
2 changed files with 24515 additions and 1 deletions

24503
dist/layui.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -205,6 +205,7 @@ var Class = function(setings){
var that = this, creat = function(){
that.creat();
};
that.yesStatus = true
that.index = ++layer.index;
that.config.maxWidth = $(win).width() - 15*2; //初始最大宽度:当前屏幕宽,左右留 15px 边距
that.config = $.extend({}, that.config, ready.config, setings);
@ -683,11 +684,21 @@ Class.pt.callback = function(){
}
}
layer.ie == 6 && that.IE6(layero);
// 节流函数
//按钮
// 按钮的事件在这里
layero.find('.'+ doms[6]).children('a').on('click', function(){
var index = $(this).index();
if(index === 0){
if(that.yesStatus){
that.yesStatus = false
setTimeout(()=>{
that.yesStatus = true
},1000)
}else{
return
}
if(config.yes){
config.yes(that.index, layero)
} else if(config['btn1']){