Home  >  Article  >  Web Front-end  >  Detailed explanation of the use of jquery layui pop-up layer

Detailed explanation of the use of jquery layui pop-up layer

php中世界最好的语言
php中世界最好的语言Original
2018-04-27 13:54:512262browse

This time I will bring you jquery a detailed explanation of the use of layui pop-up layer, what are the precautions when using jquery layui pop-up layer, the following is a practical case, let's take a look.

Jquery must be greater than 1.83

layui must be all, otherwise it will not be displayed

<script src="../js/jquery-1.8.3.min.js"></script> 
 <script src="../layui/layui.all.js"></script>

html code

<input id="about" type="button" value="修改考勤" class="layui-btn layui-btn-normal" />

Main js code

<script>
 $('input#about').on('click', function () {
 layer.confirm('是否要修改123的考勤?', {
btn: ['确定', '取消', ] //按钮
},
function () {
 layer.msg('修改成功', { time: 800, icon: 1 });
 // layer.msg('网络连接失败', { time: 800, icon: 2 });
 },
 function () {
 layer.msg('未作任何修改', {
time: 800, //20s后自动关闭
});
 }
 );
});
 </script>

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website!

Recommended reading:

JS summary of random number methods

##Query snowflake falling special effects (with code)

The above is the detailed content of Detailed explanation of the use of jquery layui pop-up layer. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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