我正在使用jquery ui对话框来查看表单。
此表单具有较大的高度值,因此对话框的顶部为0px。
我想更改此内容,因为窗口顶部有一个菜单栏。
这可能吗?
答案 0 :(得分:1)
使用位置属性
$('#some_dialog_selector').dialog({position:['center',10]});
这将打开水平居中的对话框,距离视口顶部10个像素。
答案 1 :(得分:0)
如果我理解正确,你的对话框就会覆盖窗口顶部的菜单栏。 所以你想要手动将这个对话框放低。
您可以使用'position'选项。它可以是“正确”,“左”,“底部”或“顶部” 如下 -
`$("#register-dialog").dialog({
bgiframe: true,
height: 300,
width: 400,
modal: true,
position: 'bottom'
buttons: {`
或者你可以将它定位在“右上角”。如jquery网站所示 -
Specifies where the dialog should be displayed. Possible values: 'center', 'left', 'right', 'top', 'bottom', or an array containing a coordinate pair (in pixel offset from top left of viewport) or the possible string values (e.g. ['right','top'] for top right corner).