Reputation: 923
Im new to jquery. I'm loading the pop up in my asp.net application. I want set the postion for pop up. Now its opening at center postion. please let me know how can I show the pop up on top. Can I mention the pixels for top postion? Please let me know how to do it.
here is my code
var popup = 0;
$("#modalRightCenterContent").dialog({
minHeight: 48,
minWidth: 470,
resizable: false,
modal: true,
autoOpen: false,
title: "Add Widgets"
})
Upvotes: 1
Views: 1652
Reputation: 2237
try add the following code
$('#modalRightCenterContent').css({ top: '1%', left: '50%', margin: '-' + (($('#modalRightCenterContent').height() ) - ($(window).scrollTop())) + 'px 0 0 -' + (($('#modalRightCenterContent').width() / 2)) + 'px' });
add this line and you will get top center your dialog
Upvotes: 0
Reputation: 15571
You can set the position as well:
$( ".selector" ).dialog({ position: 'top' });
Refer to this:
http://jqueryui.com/demos/dialog/#option-position
Upvotes: 1