Javascript jQuery对话框不在Chrome的中心
在FF和internetexplorer中,对话框显示在中间,而在chrome中则显示在左侧 我怎样才能解决这个问题 代码(Javascript jQuery对话框不在Chrome的中心,javascript,jquery,forms,google-chrome,jquery-ui-dialog,Javascript,Jquery,Forms,Google Chrome,Jquery Ui Dialog,在FF和internetexplorer中,对话框显示在中间,而在chrome中则显示在左侧 我怎样才能解决这个问题 代码(self是它所在的对象): $('form').live('submit',函数(e){ e、 预防默认值(); var$this=这个; console.log('单击提交') $('', {html:'确实要提交此表吗?所有撤消信息都将丢失。'}) .对话({ 莫代尔:是的, 标题:“你确定吗?”, 按钮:{ 好的:函数(){ $.get($this.action,$(
self
是它所在的对象):
$('form').live('submit',函数(e){
e、 预防默认值();
var$this=这个;
console.log('单击提交')
$('',
{html:'确实要提交此表吗?
所有撤消信息都将丢失。'})
.对话({
莫代尔:是的,
标题:“你确定吗?”,
按钮:{
好的:函数(){
$.get($this.action,$($this.serialize()+')&page='+self.pageOn,函数(数据){
控制台日志(数据);
self.pageChanged=false;
self.origPage=$('#page').clone();
self.lastClick=$('#page').clone();
})
$(this.dialog('close');
},
取消:函数(){
$(this.dialog('close');
}
},
beforeClose:function(){
$(this.remove();
}
})
返回false;
})
也许可以为对话框的div分配一个类,例如:
$('<div class="ui-dialogue">',
{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: {
或者一些类似的css将成为对话的中心。。。
这是一个猜测,但可能会迫使它在大多数浏览器上工作。thnx^^^当我将它应用于小部件元素时,它似乎工作起来。thnx^^^^在我的案例对话框中,它水平居中,但显示在顶部。我添加了
位置:'center'
选项,但不起作用。有什么想法吗?
$('<div class="ui-dialogue">',
{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: {
.ui-dialogue{margin:0 auto;}