Home  >  Article  >  Web Front-end  >  How to use open attribute to hide button in layui

How to use open attribute to hide button in layui

王林
王林Original
2020-11-24 09:53:275628browse

Layui uses the open attribute to hide the button: This can be achieved by adding the style [closeBtn:0] in the [layer.open] method. Layer provides two styles of close buttons, which can be configured by 1 and 2 to show.

How to use open attribute to hide button in layui

The operating environment of this tutorial: Windows 10 system, layui version 2.5.6. This method is suitable for all brands of computers.

(Learning video sharing: javascript video tutorial)

layui method to hide the button using the open attribute:

Method:

You can add the closeBtn:0 style in the layer.open method to achieve hiding.

closeBtn - 关闭按钮

Type:

String/Boolean, default: 1

layer provides two styles of close buttons, which can be displayed by configuring 1 and 2. If not displayed , then closeBtn: 0

Example:

layui.use('layer', function () {

        var layer = layui.layer;

        layer.open({
            skin: 'demo-class',
            type: 1,
            title: '登录',
            area: ['600px', '700px'],
            closeBtn :0,
            content: $('.login')//这里content是一个普通的String
        });
    });

Related recommendations:layui

The above is the detailed content of How to use open attribute to hide button in layui. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn