[英]Need jQuery UI dialog “window” to scroll to the top when a form inside an iframe is submitted
[英]jQuery UI close Dialog when form submitted
我一直在尝试执行以下操作:
我正在尝试以下代码:
$('#RegisterDialog').dialog({
autoOpen: false,
closeOnEscape: false,
position: 'center',
modal: true,
width: 600,
buttons: {
"Cancel account registration": function() {
$(this).dialog("close");
window.location = 'http://localhost/';
}
}
});
$(".Register").click(function() {
$('#RegisterDialog').dialog("close");
$('#RegisterDialog').hide();
});
但是,它会隐藏并再次弹出。 我也尝试过'autoClose:false'。
有什么帮助吗?
您应该尝试.remove()
。
这将删除该元素,并且不会再次弹出。
从jQuery文档...
.dialog( "destroy" )
// Remove the dialog functionality completely. This will return the element back to its pre-init state.
这可能会成功。
我想你应该这样
$(".Register").click(function() {
$('#RegisterDialog').dialog("close");
//$('#RegisterDialog').hide(); --> no need to call this
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.