我有行的元素与编辑按钮,显示悬停。我试图打开我点击编辑按钮的元素旁边的jQuery对话窗口: 当打开jQuery对话框的页面滚动
到目前为止这么好。
这是我的问题:对话框在正确的地方打开,但是页面同时向下滚动,我打开对话框。
jQuery的对话框代码:用于对话框并且设置对话框位置
$("#object-form").dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true,
buttons: {
Save: function() {
alert("hello");
},
Abort: function() {
$(this).dialog("close");
}
},
show: "slow"
});
初始化代码:
$(".matrix-cell-options-edit").click(function() {
$("#object-form").dialog("open");
var target = $(this).parent().parent();
$("#object-form").dialog("widget").position({
my: 'left bottom',
at: 'right top',
of: target
});
});
在设置位置之后放置“对话框(”打开“)'时,滚动仍然发生吗? – Jason
是的不幸的是它确实。 – Superbyte
这个问题http://stackoverflow.com/questions/2777408/window-scrolling-up-when-jquery-dialog-opens-up可能会证明有帮助 – Jason