//htnml部分
<button id="buttonadd">点击</button>
<div id="tanchuang" style="display: none">
<button id="bottongb">关闭</button>
</div>
js部分
var index = "";
//添加
$("#buttonadd").on("click",function () {
index = layer.open({
type: 1,
title: '编辑',
area: ['80%', '80%'],
shade: 0,
content: $('#tanchuang'),
end : function() {
$("#tanchuang").attr('style',"display: none");
}
})
})
$("#bottongb").click(function () {
//当你在iframe页面关闭自身时
layer.close(index);
$("#tanchuang").attr('style',"display: none");
})