How to use open attribute to hide button in layui

王林
Release: 2020-11-30 13:48:01
Original
5661 people have browsed it

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 - 关闭按钮
Copy after login

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
        });
    });
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!