题
我有这个对话框代码
// load dialog to user signup
function new_user_signup()
{
$.get("/actions/_new_user_account.php",
function(data){
$("#dialog").html(data);
});
$("#dialog").dialog({ width: 400,resizable: false, position: 'top', draggable: false, title: 'Opret profil' });
}
如果我点击右上方的X图标,然后尝试再次打开我的对话框,我就不能。
如何再次打开对话框?
解决方案
您必须使用 open 方法重新打开对话框:
$("#dialog").dialog('open');
其他提示
您需要初始化一次,然后在每次调用函数时重新打开它。像这样:
// initialize dialog after page is loaded, pay attention to "autoOpen: false"
$(document).ready(function(){
$("#dialog").dialog({ width: 400,resizable: false, position: 'top', draggable: false, title: 'Opret profil', autoOpen: false });
});
// load dialog to user signup
function new_user_signup()
{
$.get("/actions/_new_user_account.php",
function(data){
$("#dialog").html(data);
}
);
$("#dialog").dialog('open');
}
不隶属于 StackOverflow