Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use layui pop-up window

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces how to use the layui pop-up window, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

There are three types of layui pop-up windows, namely: 1, confim type; 2, open type pop-up box; 3, msg type. The following is to introduce how to use these pop-up windows one by one.

Method of using 1:confim type

Layui.use ('layer', function () {layer.confirm (' do you want to upload file information now?' , {btn: ['Yes','No'], time: 200000, / / automatically close after 20s}, function (index) {alert ("this is the callback of clicking OK button") layer.close (index);}, function () {alert ("this is the callback of clicking the cancel button");})

2:open type pop-up box, the content parameter can be a selector or a path

Layer.open ({type: 1title: "borrowing time", area: ['450pxtimes,' 300px`], content: $("# borrowCase"), btn: ['OK', 'cancel'], yes: function (index) {alert ("this is the callback for clicking the OK button")}, btn2: function () {alert ("this is the callback for clicking the cancel button")} End:function () {alert ('this is a callback that will go when any button is clicked')}) Layui.use ('layer',function () {var layer=layui.layer;layer.open ({new field information for type:2,title:'', area: ['450px'], content: "dictionary/addFiled?dictionaryId=" + dictionaryId// field type})}))

3:msg Typ

Layer.msg ('loan added successfully', {time: 1500, / / 1500ms automatically closed})

4: close the pop-up window

Layer_close (index) closes the current pop-up window parent.layer.closeAll () closes all pop-up windows. Thank you for reading this article carefully. I hope the article "how to use layui Pop-up window" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report