当我在脚本中调用下面的函数时,我会看到一个弹出对话框来执行一些说明。
这是我的示例代码:
function updateStatus(instrxnID){
exporter.fn.childWindow({
instrxnID : instrxnID,
url:'pgks/fund/update/view.page'
},'pgks','Popup',{top:100,height:459,width:884,left:200});
}
exporter.fn.childWindow 将调用以下函数来打开弹出窗口'
childWindow : function(elements,path,title,setting){
setting = setting != undefined ? setting : {top:100,height:300,width:400,left:200};
var keys = exporter.fn.keys(elements);
var offset = "width="+setting.width+",height="+setting.height+",top="+setting.top+",left="+setting.left;
myWin = open("", "displayWindow", offset+",scrollbars=no,status=no,dependent=yes,directories=no,menubar=no,personalbar=no");
myWin.document.open();
myWin.document.write("<html><head>");
myWin.document.write("</head><body><form name='form' action='"+elements.url+"' type='post'>");
for ( var a = 0; a < keys.length; a++) {
myWin.document.write('<input type="hidden" name="'+keys[a]+'" value="'+elements[keys[a]]+'">');
}
myWin.document.write("</form><script type='text/javascript'>form.method=\'post\';form.submit();</script></body></html>");
myWin.document.close();
}
完成这些指令后,我应该返回到此弹出窗口的主页或父页面。
注意:通过单击背景页面或其他链接,此模式不应消失。
示例:我需要实现这样的目标 example
最佳答案
将点击处理程序附加到提交按钮,或将提交处理程序附加到表单。在此处理程序中,隐藏 (display: none;
) 您的弹出窗口,或者,如果您为弹出窗口使用窗口对象,请在实例上调用 .close()
。
编辑:
$(".my-button").on("click", function() {
myWin.close();
});
关于javascript - 如何在这个函数调用中使 "modal conformation"功能起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20092072/