Home > front end >  Layui pop-up layer (open) properties is introduced
Layui pop-up layer (open) properties is introduced

Time:11-03

Layui framework is a written by its own module specification front end UI framework, follow the original HTML/CSS/JS and organization form of writing, the threshold is very low, brought the box, this article introduce the layui pop-up layer (open) the properties of the hope to have certain help,

Layui. Open properties such as: open a popup layer

Core method

Var index=layer. Open ({

Type: 2,

Title: the title,

Maxmin: true,

Offset: '100 px,

Area: [' 600 px ', '500 px],

Content: the prefix + url//iframe url

});

Layer. The full (index);//minimize

Type - the basic layer class

Type: Number, default: 0

Layer provides five layer type, can be incoming values: 0 (information box, default) 1 (pages) 2 (iframe layer) 3 layer (load) 4 layer (tips), if you use layer. The open call ({1} type:) way, is the type is required (except information box)

Title - title

Type: String Array/Boolean. Default: 'information
'
Title supports three types of value, if your incoming is common string, such as the title: 'I am a title', so will only change the title text; If you need a custom title regional style, then you can be the title: [" text ", "the font - size: 18 px; '], the second array can write any CSS style; If you don't want to display the title bar, you can be the title: false

The content - content

Type: String/DOM/Array, the default, "

The content to the incoming value is flexible, not only can pass in plain HTML content, you can also specify the DOM, more could be vary with the type (define a form when the form directly introduced by (" # id "), DOM object form validation is not influence, if

# (" id "). The HTML () to take out the HTML element,)

Skin - style class name

Types: String, the default, "

The style of the skin to allow incoming layer built-in class name, also can be introduced into the custom class name, there is layer built-in skin: layui - layer - lanlayui - layer - molv recommended himself to define the

Area - wide high

Type: String/Array, the default: 'auto'

By default, the layer is wide high are adaptive, but when you want to define the width, you can area: "500 px", is still highly adaptive, when you to define a wide high, you can area: [' 500 px ', '300 px]

Offset - coordinate

Type: String/Array, the default: vertical horizontal center

Offset by default without setting, but if you don't want to vertical horizontal center, can query website assignment

Maxmin - minimizing,

Types: Boolean, default: false

The parameter values of type 1 and type: 2, the default button, don't show the size need to display the configuration maxmin: true
  • Related