我遇到的问题与this question中的相同,但现在适用于所有浏览器。未在中心显示jQuery对话框
下面是代码:
$('form#main').live('submit', function(e) {
e.preventDefault();
var $this = this;
////console.log('click submit')
var $div = $('<div>', {
html: 'Are you sure you want to submit this table?<br/> All undo information will be lost.'
}).dialog({
modal: true,
title: 'Are You Sure?',
buttons: {
ok: function() {
self.console('clicked ok');
$.post($this.action, $($this).serialize() + '&page=' + self.pageOn, function(data) {
self.console(data);
$('.DEV-time').text(" (File last updated at: " + data.DEV + ")");
$('.PROD-time').text(" (File last updated at: " + data.PROD + ")");
if(data.ERROR.length > 0){
alert(data.ERROR);
}
self.pageChanged = false;
self.origPage = $('#page').clone();
self.lastClick = $('#page').clone();
}, 'json')
$(this).dialog('close');
},
cancel: function() {
$(this).dialog('close');
}
},
beforeClose: function() {
$(this).remove();
}
})
$div.dialog('widget').css('margin', '0 auto');
return false;
})
这很刺激。 – Brandon 2011-05-04 20:05:16
但它没有意义 – Neal 2011-05-04 20:05:49
顺便说一句,你有一个失踪;当关闭对话框定义时,就在刚删除的那一行之前。 – eagerMoose 2011-05-04 20:07:50