How to adjust the size of the pop-up box in layui: first create a new HTML code page; then use link to link an external style layer.css file; then create a pop-up box; and finally use it in the "layer.opren()" method "area:[]" can set the size of the pop-up box.

Recommended: "layUI Tutorial"
Open the front-end development tool and create a new html code page

Look for the

Insert the two external files jquery.js and layer.js after the linked layer.css file

to create a pop-up box. Create a new <script> tag, and then use layer.open() in this tag to create a pop-up box function. </script>
Create pop-up box code:
layer.open({
type: 2,
content: "test.html"
})
View the pop-up box effect. After saving the html code file, open it with a browser. At this time, you can see that the pop-up box has been functionally implemented

Modify the size of the pop-up box. Use area:[] in the layer.opren() method to set the width/height of the pop-up box.
Code:
layer.open({
type: 2,
area:["500px","400px"],
content: "test.html"
})
Save the html code and refresh the browser page, you can see that the size of the pop-up box has been modified

The above is the detailed content of How to adjust the size of the pop-up box in layui. For more information, please follow other related articles on the PHP Chinese website!