Home Web Front-end Layui Tutorial Some pop-up boxes used in layui

Some pop-up boxes used in layui

Jun 08, 2020 pm 05:30 PM
layui

Some pop-up boxes used in layui

Step One: Reference File

Some pop-up boxes used in layui

Step Two: Write Script

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

<script>

//iframe窗

//layer.open({

// type: 2,

// title: false,

// closeBtn: 0, //不显示关闭按钮

// shade: [0],

// area: [&#39;340px&#39;, &#39;215px&#39;],

// offset: &#39;rb&#39;, //右下角弹出

// time: 2000, //2秒后自动关闭

// anim: 2,

// content: [&#39;text1.html&#39;, &#39;no&#39;], //iframe的url,no代表不显示滚动条 右下角页面

// end: function () { //此处用于演示

// layer.open({

// type: 2,

// title: &#39;很多时候,我们想最大化看,比如像这个页面。&#39;,

// shadeClose: true,

// shade: false,

// maxmin: true, //开启最大化最小化按钮

// area: [&#39;893px&#39;, &#39;600px&#39;],

// content: &#39;text.html&#39; //最大化页面

// });

// }

//});

 

//初体验

//layer.alert(&#39;内容&#39;)

//第三方扩展皮肤

//layer.alert(&#39;内容&#39;, {

// icon: 1,

// skin: &#39;layer-ext-moon&#39; //该皮肤由layer.seaning.com友情扩展。关于皮肤的扩展规则,去这里查阅

//})

 

//询问框

//layer.confirm(&#39;您是如何看待前端开发?&#39;, {

// btn: [&#39;重要&#39;, &#39;奇葩&#39;] //按钮

//}, function () {

// layer.msg(&#39;的确很重要&#39;, { icon: 1 });

//}, function () {

// layer.msg(&#39;的确是奇葩&#39;, { icon: 1 });

//});

 

//提示层

//layer.msg(&#39;玩命卖萌中&#39;, function () {

// //关闭后的操作

//});

layer.msg(&#39;更新成功&#39;,{time:1000}, function () {

parent.location.reload();    //刷新父页面   第二个参数设置msg显示的时间长短

});

 

//墨绿深蓝风

//layer.alert(&#39;墨绿风格,点击确认看深蓝&#39;, {

// skin: &#39;layui-layer-molv&#39; //样式类名

// , closeBtn: 1

//}, function () {

// layer.alert(&#39;偶吧深蓝style&#39;, {

// skin: &#39;layui-layer-lan&#39;

// , closeBtn: 1

// , anim: 4 //动画类型

// });

//});

 

//页面层

//layer.open({

// type: 1,

// skin: &#39;layui-layer-rim&#39;, //加上边框

// area: [&#39;auto&#39;, &#39;auto&#39;], //宽高

// content: &#39;<div id="dd" style="border:1px solid red;width:100px; height:100px;background-color:pink;">今天要下雪了</div>&#39;

//});

 

//自定页

//layer.open({

// type: 1,

// skin: &#39;layui-layer-demo&#39;, //样式类名

// closeBtn: 1, //0不显示关闭按钮

// anim: 2,

// shadeClose: true, //开启遮罩关闭

// content: &#39;<div id="dd" style="border:1px solid red;width:100px; height:100px;background-color:pink;">今天要下雪了</div>&#39;      也可以跳转到某个页面 content: "@Url.Action("Detial", "UserInfo")?id="+id

//});

 

//tips层

//layer.tips(&#39;Hi我是tips&#39;, &#39;#btn&#39;); //第二个参数是吸附元素选择器,如#id

 

//iframe层

//layer.open({

// type: 2,

// title: &#39;layer mobile页&#39;,

// shadeClose: true,

// shade: 0.8,

// area: [&#39;70%&#39;, &#39;90%&#39;],//宽 高

// content: &#39;text.html&#39;

//});

 

////加载层-默认风格

//layer.load();

////此处演示关闭

//setTimeout(function () {

// layer.closeAll(&#39;loading&#39;);

// layer.msg("关闭了");

//}, 2000);

 

//小tips

//layer.tips(&#39;我是另外一个tips,只不过我长得跟之前那位稍有些不一样。&#39;, &#39;吸附元素选择器&#39;, {

// tips: [1, &#39;#3595CC&#39;],

// time: 4000

//});

 

//prompt层

//layer.prompt({ title: &#39;输入任何口令,并确认&#39;, formType: 1 }, function (pass, index) {

// layer.close(index);

// layer.prompt({ title: &#39;随便写点啥,并确认&#39;, formType: 2 }, function (text, index) {

// layer.close(index);

// layer.msg(&#39;演示完毕!您的口令:&#39; + pass + &#39;<br>您最后写下了:&#39; + text);

// });

//});

 

//tab层

//layer.tab({

// area: [&#39;600px&#39;, &#39;300px&#39;],

// tab: [{

// title: &#39;TAB1&#39;,

// content: &#39;内容1&#39;

// }, {

// title: &#39;TAB2&#39;,

// content: &#39;内容2&#39;

// }, {

// title: &#39;TAB3&#39;,

// content: &#39;内容3&#39;

// }]

//});

 

//相册层

//$.getJSON(&#39;test/photos.json?v=&#39; + new Date, function (json) {

// layer.photos({

// photos: json //格式见API文档手册页

// , anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机

// });

//});

</script>

Copy after login

MorelayuiFor knowledge, please pay attention to the layui tutorial column on the PHP Chinese website

The above is the detailed content of Some pop-up boxes used in layui. For more information, please follow other related articles on the PHP Chinese website!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to set up jump on layui login page How to set up jump on layui login page Apr 04, 2024 am 03:12 AM

Layui login page jump setting steps: Add jump code: Add judgment in the login form submit button click event, and jump to the specified page through window.location.href after successful login. Modify the form configuration: add a hidden input field to the form element of lay-filter="login", with the name "redirect" and the value being the target page address.

How to get form data in layui How to get form data in layui Apr 04, 2024 am 03:39 AM

layui provides a variety of methods for obtaining form data, including directly obtaining all field data of the form, obtaining the value of a single form element, using the formAPI.getVal() method to obtain the specified field value, serializing the form data and using it as an AJAX request parameter, and listening Form submission event gets data.

How layui implements self-adaptation How layui implements self-adaptation Apr 26, 2024 am 03:00 AM

Adaptive layout can be achieved by using the responsive layout function of the layui framework. The steps include: referencing the layui framework. Define an adaptive layout container and set the layui-container class. Use responsive breakpoints (xs/sm/md/lg) to hide elements under specific breakpoints. Specify element width using the grid system (layui-col-). Create spacing via offset (layui-offset-). Use responsive utilities (layui-invisible/show/block/inline) to control the visibility of elements and how they appear.

How to transfer data in layui How to transfer data in layui Apr 26, 2024 am 03:39 AM

The method of using layui to transmit data is as follows: Use Ajax: Create the request object, set the request parameters (URL, method, data), and process the response. Use built-in methods: Simplify data transfer using built-in methods such as $.post, $.get, $.postJSON, or $.getJSON.

What is the difference between layui and vue? What is the difference between layui and vue? Apr 04, 2024 am 03:54 AM

The difference between layui and Vue is mainly reflected in functions and concerns. Layui focuses on rapid development of UI elements and provides prefabricated components to simplify page construction; Vue is a full-stack framework that focuses on data binding, component development and state management, and is more suitable for building complex applications. Layui is easy to learn and suitable for quickly building pages; Vue has a steep learning curve but helps build scalable and easy-to-maintain applications. Depending on the project needs and developer skill level, the appropriate framework can be selected.

What does layui mean? What does layui mean? Apr 04, 2024 am 04:33 AM

layui is a front-end UI framework that provides a wealth of UI components, tools and functions to help developers quickly build modern, responsive and interactive web applications. Its features include: flexible and lightweight, modular design, rich components, Powerful tools and easy customization. It is widely used in the development of various web applications, including management systems, e-commerce platforms, content management systems, social networks and mobile applications.

What language is layui framework? What language is layui framework? Apr 04, 2024 am 04:39 AM

The layui framework is a JavaScript-based front-end framework that provides a set of easy-to-use UI components and tools to help developers quickly build responsive web applications. Its features include: modular, lightweight, responsive, and has complete documentation and community support. layui is widely used in the development of management backend systems, e-commerce websites, and mobile applications. The advantages are quick start-up, improved efficiency, and easy maintenance. The disadvantages are poor customization and slow technology updates.

The difference between layui framework and vue framework The difference between layui framework and vue framework Apr 26, 2024 am 01:27 AM

layui and vue are front-end frameworks. layui is a lightweight library that provides UI components and tools; vue is a comprehensive framework that provides UI components, state management, data binding, routing and other functions. layui is based on a modular architecture, and vue is based on a componentized architecture. layui has a smaller ecosystem, vue has a large and active ecosystem. The learning curve of layui is low, and the learning curve of vue is steep. Layui is suitable for small projects and rapid development of UI components, while vue is suitable for large projects and scenarios that require rich functions.

See all articles