我想将两个对话框放在一起。我执行以下操作:
$("#deck").dialog({
width: 'auto',
height: 'auto',
position: {
my: 'left top',
at: 'left bottom',
of: '#title',
}
});
$("#seats").dialog({
width: 'auto',
height: 'auto',
position: {
my: 'left top',
at: 'right top',
of: '#deck',
},
});
但是,这会将 #seats
定位到 #deck
div 的右上角,而不是 #deck
对话框,所以这两个对话框由于标题栏不同而未对齐。我将如何定位 #seats
相对于 #deck
的实际对话框?我试过使用 #deck :parent
、#deck :parent :parent
的 of
,并传入 的返回值>$("#deck").dialog(...)
但都没有给出预期的结果。我宁愿不硬编码标题栏的高度。
最佳答案
以下完美运行:
$("#seats").dialog({
width: 'auto',
height: 'auto',
position: {
my: 'left top',
at: 'right top',
of: $('#deck').parent(),
},
});
关于javascript - jqueryui 对话框相对于其他对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15280850/