List HTML: data- and class="del"
<td> <a href="{:U('Single/single',['sid'=>$ls['sid']])}" rel="external nofollow" class="layui-btn layui-btn-mini"> edit </a> <a href="javascript:;" rel="external nofollow" data- data-opt="del" class="layui-btn layui-btn-danger layui-btn-mini del"> delete </a> </td>
js:
<script type="text/javascript"> ('layer', function(){ var $ = ; // Delete operation $('').click(function() { var sid = $(this).data('id');// Get the id of the click item ("Confirm to delete it, it cannot be restored after deletion", { title: "Delete Confirm" }, function (index) { $.post("{:U('Admin/Single/del')}", { sid: sid }, function (data) { var num = ==200 ? 1 : 2; (,{icon:num,shade:0.3,offset: '40%',time:2000}); //(index); //If the yes callback is set, it needs to be manually closed setTimeout(function(){ //refresh (); },1000); }); }); }) }) </script>
The above example of the deletion confirmation interface of the layui pop-up is all the content I share with you. I hope you can give you a reference and I hope you can support me more.