Layer repeated pop-up (multiple layui bomb layers exist at the same time) solution

Solve the problem of multiple clicks on the layui pop-up layer to pop up

This problem is actually negligence of some basic parameters (look at the document carefully, read the document carefully, read the document carefully)

1. type-basic layer type
Type: Number, default: 0
layer provides 5 layer types. The available values ​​are: 0 (information box, default) 1 (page layer) 2 (iframe layer) 3 (loading layer) 4 (tips layer). If you use layer.open({type: 1}) to call, the type is required (except the message box)

2. id-used to control the unique identification of the bomb layer
Type: String, default: empty character After
setting this value, no matter what type of layer it is, only one layer is allowed to pop up at the same time. Generally used in page layer and iframe layer mode

When multiple bomb layers appear at the same time, setting an ID can solve this problem.

Example:

layer.open({
    
    
    type: 1
    ,title: false //不显示标题栏
    ,closeBtn: false
    ,area: '300px;'
    ,content : "url"
    ,shade: 0.8
    ,id: 'LAY_layuipro' //设定一个id,防止重复弹出
});

This content Reprinted from:
Author: dongsir
description link: https://www.cnblogs.com/sirdong/archive/2019/10/23/11728160.html

Guess you like

Origin blog.csdn.net/Mr_TXQ/article/details/107833439