2013-10-28 38 views
1

我从jquery-1.6.4.min.jsjquery-ui-1.7.2.j小号升级的Jquery版本jquery-1.10.2.jsjQuery的位置是不是给预期的结果

和jQuery UI的版本jquery-ui-1.10.3.js

我已经包括了最新版本的jQuery的ui.css也。

这是我正在使用的脚本标记。

<script type="text/javascript" src="JS/jquery-1.10.2.js"></script> 
<script type="text/javascript" src="JS/jquery-ui-1.10.3.js"></script> 

这样我打开一个对话框。

dialog = $('#dialog-modal-error'); 
dialog.html (l_str); 
dialog.dialog(); /* if i am not using this then it is giving me this error msg. cannot call methods on dialog prior to initialization; attempted to call method 'option'*/ 
if (dialog.dialog ('option', 'disabled') == undefined) { 
    dialog.dialog (
     { 
      autoOpen: true, 
      position : { my: 'center', at: 'center'}, 
      modal : false, 
      bgiframe : true, 
      buttons: {}, 
      close : minimizeMessages, 
      resizable : false, 
      draggable : false 
     } 

    ); 


} else { 
    dialog.dialog ('open'); 

} 

因此,它总是打开我的对话框在页面的右下角,所以只是想知道为什么它会显示我这种行为。

我已经检查了所有的CSS没有采取任何继承的CSS。

编辑:

我用这个也position : { my: 'center', at: 'center', collison: 'none'},但没有工作。

随着最后一个版本的jquery它工作正常。

注:对话框总是出来的画面(左汉字)

回答

0

退房的jQuery UI的文档(http://api.jqueryui.com/dialog/#option-position)看来你已经离开了of属性了。 position的默认值是{ my: "center", at: "center", of: window }。因此,请尝试指定of: window属性。

+0

我已经检查过,但这也不会导致我预期的行为。 –

0

使用'''属性来正确定位它。你想把它定位在哪里?

例如:

position:{ my: "center", at: "center", of: $("#aDiv")} 

这也可以理解为: 地方我对话框的中心,在与ID ADIV的div中心。

相关问题