如何从另一个页面关闭模式形式 [英] how do close modal form from another page
问题描述
$(document).ready(function()
{
$("#create-user").button().click(function()
{
$("#dialog-form").load('test.html').dialog({ modal:true, });
});
});
我有两页.从第一页开始,我想使用url test.html调用模式形式,并且我想通过关闭来关闭test.html页面的模式形式
i have two page. from first page i want to call modal form with url test.html and i want to close the modal form from test.html page with Close
推荐答案
SimpleModal 会自动绑定close函数(使用 onclick事件)添加到对话框中的任何元素,并带有 simplemodal-close类.
SimpleModal will automatically bind the close function (using the onclick event) to any element inside the dialog with the simplemodal-close class.
此外,您可以以编程方式关闭当前打开的 对话框,方法是调用$ .modal.close();
In addition, you can programmatically close the currently opened dialog by calling $.modal.close();
这意味着:在closeWindow()函数中,您只需输入以下行即可:
This means: in your closeWindow()-function, you could simply enter the line:
$.modal.close();
这篇关于如何从另一个页面关闭模式形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!