Home > Article > Web Front-end > How to use jquery layui popup layer
This time I will show you how to use jquery layui pop-up layer. What are the precautions for 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:
How to use the image display plug-in highslide.js in jQuery
How to use Angularjs custom instructions
The above is the detailed content of How to use jquery layui popup layer. For more information, please follow other related articles on the PHP Chinese website!