2013-03-07 128 views
1

我想将两个对话框放在一起。我做到以下几点:相对于其他对话框的jqueryui对话框

$("#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,并传入返回值$("#deck").dialog(...),但都没有给出所需的结果。我宁愿不硬编码标题栏的高度。

回答

2

以下作品完美:

$("#seats").dialog({ 
    width: 'auto', 
    height: 'auto', 
    position: { 
    my: 'left top', 
    at: 'right top', 
    of: $('#deck').parent(), 
    }, 
});