layer弹出层嵌套调用问题的实例代码layer弹出层嵌套调用问题的实例代码 //首次调用layer.open({ type: 2, title: '打印', content: '/Account/AddPrintInfo?cardId=' + data.Base_CardId, area: ['90%', '30%'], success: function (layero, index) { }, end: function () { }, btn: ['确定','关闭'] , yes: function (index, layero) {
//首次调用
layer.open({
type: 2,
title: '打印',
content: '/Account/AddPrintInfo?cardId=' + data.Base_CardId,
area: ['90%', '30%'],
success: function (layero, index) {
},
end: function () {
},
btn: ['确定','关闭']
, yes: function (index, layero) {
var thisIndex = index;
layer.confirm('确定保存么', { icon: 3, title: '提示' }, function (index) {
var body = layer.getChildFrame('body', index);
var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();]
if (iframeWin.AddPrintInfoAction()) {
//关闭confirm
layer.close(index);
setTimeout(function () {
//关闭layer
layer.close(thisIndex);
//当弹出的第一个页面完成操作后判断结果,如果结果为真则关闭之前弹出的内容,弹出新的内容页(第二次调用)
layer.open({
type: 2,
title: '打印',
content: '/Account/AddPrintInfoPage?cardId=' + data.Base_CardId,
area: ['98%', '98%'],
success: function (layero, index) {
},
end: function () {
},
btn: ['打印']
, btn1: function (index, layero) {
var body = layer.getChildFrame('body', index);
console.log("layero", layero);
//此处在回调中获得的layero,为当前弹出层的内容,通过该内容获取iframe标签信息,与单层弹出相同
var iframeWin = window[layero.find('iframe')[0]['name']];
console.log("iframeWin", iframeWin);
iframeWin.printPage();
}
});
}, 2 * 1100);
}
else {
layer.close(index);
return false;
}
});
}
});
沃梦达教程
本文标题为:layer弹出层嵌套调用问题的实例代码
猜你喜欢
- Bootstrap动画进度条 1970-01-01
- Bootstrap警告 1970-01-01
- Bootstrap .alert类 1970-01-01
- Bootstrap有边界表格布局 1970-01-01
- Bootstrap将徽章添加到列表组 1970-01-01
- Bootstrap标签内 2022-07-13
- Bootstrap禁用链接 1970-01-01
- Bootstrap下拉导航栏 1970-01-01
- Bootstrap .caret类 1970-01-01
- Bootstrap添加红色标签 1970-01-01