2011-11-29 87 views
1

Im新的jquery。 我正在加载弹出在我的asp.net应用程序。 我想设置弹出的位置。 现在它的中心位置开幕。 请让我知道如何显示弹出窗口。 我可以提到顶级位置的像素吗? 请让我知道如何去做。设置弹出的位置

这里是我的代码

var popup = 0; $("#modalRightCenterContent").dialog({ minHeight: 48, minWidth: 470, resizable: false, modal: true, autoOpen: false, title: "Add Widgets" })

回答

0

尝试添加以下代码

$('#modalRightCenterContent').css({ top: '1%', left: '50%', margin: '-' + (($('#modalRightCenterContent').height()) - ($(window).scrollTop())) + 'px 0 0 -' + (($('#modalRightCenterContent').width()/2)) + 'px' }); 

添加此行,您将获得顶部中心对话框