我无法让我的 jquery 对话框出现在页面顶部。我已经尝试了我在网上看到的所有内容,但它只是不会移动。以下是我尝试过的几件事:
$('#dlgChange').dialog({
autoOpen: false,
modal: true,
width: '800',
resizable: false,
title: Details,
position: {
my: "left top",
at: "left top",
of: window, //I also tried $('.right-container) - this is the full right side of my page
collision: "none"
}
});
$('#dlgChange').dialog({
autoOpen: false,
modal: true,
width: '800',
resizable: false,
title: 'Details',
position: 'top',
});
我试图在对话框打开后调整位置:
$('#dlgChange').dialog('option', 'position', 'top');
没有将对话框移动到页面顶部。它始终处于中心位置。我需要将它向上移动,因为对话框的底部正在移出页面。我有 jquery-ui 版本 1.12.1 和引导程序 3.3.6。似乎导致问题的 css 是下面的粗线。
.ui-dialog {
left: 50% !important;
**top: 50% !important;**
margin-left: -175px !important;
margin-top: -175px !important;
position: fixed;
}
任何帮助是极大的赞赏。谢谢你
你可以这样做:
var yourPosition = {
my: "center top",
at: "center top+50"
};
$(function() {
$("#dlgChange").dialog({
position: yourPosition,
});
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句