无法使多个对话框相互关联定位

时间:2014-08-18 21:38:02

标签: jquery dialog position

我不确定我做错了什么。我想要将两个对话框排成一行。 "顶"在顶部和"底部"在底部。定位似乎没有效果。

这是我的HTML

<body> 
<div id="top">
  <p>This is the top element.</p>
</div>

<div id="bottom">
  <p>bottom element</p>
</div>
</body>

这是我的jquery

$(document).ready(function() 
{
    $('#top').dialog({
        resizable: false,
        modal: true,
        width: 500,
        height: 300
    });  

    $('#bottom').dialog({
        resizable: false,
        modal: true,
        width: 500,
        height: 200,
        position: {
                of: $('#top'),
                my: 'top left',
                at: 'bottom left'
            }
    });  
  });

和我的CSS

#top {
    margin: 10px auto;
    padding: 5px;
    border: 1px solid #777;
    background-color: #fbca93;
    text-align: center;
}

#bottom {
    border: 1px solid #777;
    text-align: center;
}

0 个答案:

没有答案