源码中 closeWindow方法改一下,去掉窗口移除的代码,如下:
closeWindow: function() {
var context = this;
$("#translucent_close").bind("click", function() {
if (context.config.close !== null && typeof context.config.close === "function") {
context.config.close($(".translucent-container"));
}
// $(".translucent-container").remove();
});
},然后你在html中调用的时候,关闭回调函数那里,写一个关闭提示窗口,点是的时候再加上窗口移除的代码,我这里是用的layui的提示窗口:
$body.translucent({
// height:450,
width: 400,
height: 420,
positionLeft: posLeft,
positionTop: posTop,
titleText: "概要信息",
titleGroundColor: "#3385FF",
backgroundColor: "#ffffff",
titleFontColor: "#ffffff",
titleFontFamily: "Tahoma, Verdana, 宋体",
opacity: 0.8,
zIndex: 100,
textHtml: html,
close: function($dom) {
layer.confirm('确定要关闭吗?', {
btn: ['确定', '取消'] //按钮
}, function() {
$dom.remove();
layer.closeAll();
return true;
}, function() {
layer.closeAll();
return false;
}, {
icon: "3"
});
}
});