2011-11-29 100 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' }); 

添加此行,您將獲得頂部中心對話框