标签:index tno ase ntb func listener list break add
function systc() { var t = layer.confirm(‘确认要退出系统吗?‘, { btn: [‘确定‘, ‘取消‘] //按钮 }, function () { $("#btnDel").click(); }, function () { }); document.getElementById(‘layui-layer‘ + t).addEventListener("click", event); function event(e) { var that = e.target; switch (that.nodeName.toLowerCase()) { case ‘a‘: //检测 类是否存在 ; if (that.innerText == "确定" || that.innerText == "取消" ) { var dm = document.getElementById(‘layui-layer‘ + t); dm.parentNode.removeChild(dm); var shade = document.getElementById(‘layui-layer-shade‘ + t); shade.parentNode.removeChild(shade); if (that.innerText == "确定") { $("#btnDel").click(); } } if (that.className.indexOf("layui-layer-close") != -1) { var dm = document.getElementById(‘layui-layer‘ + t); dm.parentNode.removeChild(dm); var shade = document.getElementById(‘layui-layer-shade‘ + t); shade.parentNode.removeChild(shade); } break; } e.cancelBubble = true; e.stopPropagation(); } }
标签:index tno ase ntb func listener list break add
原文地址:https://www.cnblogs.com/enych/p/12985424.html