设置弹出的位置
问题描述:
Im新的jquery。 我正在加载弹出在我的asp.net应用程序。 我想设置弹出的位置。 现在它的中心位置开幕。 请让我知道如何显示弹出窗口。 我可以提到*位置的像素吗? 请让我知道如何去做。设置弹出的位置
这里是我的代码
var popup = 0; $("#modalRightCenterContent").dialog({ minHeight: 48, minWidth: 470, resizable: false, modal: true, autoOpen: false, title: "Add Widgets" })
答
您可以设置的位置,以及:
$(".selector").dialog({ position: 'top' });
请参阅本:
答
尝试添加以下代码
$('#modalRightCenterContent').css({ top: '1%', left: '50%', margin: '-' + (($('#modalRightCenterContent').height()) - ($(window).scrollTop())) + 'px 0 0 -' + (($('#modalRightCenterContent').width()/2)) + 'px' });
添加此行,您将获得顶部中心对话框