如何制作“;模态构象”;此函数调用中的功能

How to make "modal conformation" functionality in this function call?

本文关键字:函数调用 功能 何制作 模态      更新时间:2023-09-26

当我在脚本中调用下面的函数时,我会得到一个弹出对话框来执行一些指令。

这是我的示例代码:

function updateStatus(instrxnID){
            exporter.fn.childWindow({
                instrxnID : instrxnID,
                url:'pgks/fund/update/view.page'
            },'pgks','Popup',{top:100,height:459,width:884,left:200});
        }

导出器.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();
    }

完成这些指令后,我应该返回到这个弹出窗口的主页或父页。

注意:通过单击背景页或其他链接,此模式不应取消。

示例:我需要获得类似以下示例的

在提交按钮上附加一个点击处理程序,或者在表单上添加一个提交处理程序。在这个处理程序中,隐藏(display: none;)弹出窗口,或者,如果使用窗口对象进行弹出窗口,则在实例上调用.close()

编辑:

$(".my-button").on("click", function() {
  myWin.close();
});