http://layer.layui.com/api.html
https://www.layui.com/demo/layer.html
【1】layer.open
<span id="reset" οnclick="uploadfile()">添加</span>
function uploadfile() {
//window.open(this.href, '', 'width=255,height=255');
layer.open({
type: 2,
skin: 'layui-layer-demo', //样式类名
title: '',
closeBtn: 0, //不显示关闭按钮
anim: 2,
area: ['680px', '380px'],
shadeClose: true, //开启遮罩关闭
content: 'img.html'
});
}
<div style="position:absolute;z-index:99;background-color: rgba(0, 0, 0,0);top:10px;left:600px;width:60px;height:40px;" id="closeImg">
$("#closeImg").click(function () {
//关闭当前页
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
});
【2】layer.prompt
layer.prompt(
{
formType: 2,
value: data.name,
title: "审核"
},
function (value, index) {
obj.update({
name: value
});
layer.close(index);
});
$(".layui-layer-content").append("<br/><input type=\"text\" id= \"zxr\" class=\"layui-input\" placeholder=\"审核人\"/>")
layer.confirm('下载该文件',
{title:"下载"},
function (index) {
obj.del();
layer.close(index);
});