1

I am stuck with a minor problem in aligning the dialog window to the center of the screen. Position is set to center, but the problem is, the dailog window's left top corner is the one is aligned to the center of the screen... is there any way that i can overcome this.

 // Dialog box properties for Select drive
  $(".Drive").dialog({ 
  title:  'Form Design'
  , width:  'auto'
  , height:  'auto'
  , autoOpen: false
  , position: 'center'
  , closeOnEsc: true
  , modal:  true,
  });
  $('.driveChoose').click(function(){
  var modalUrl = $(this).attr('title'); 
  $('.Drive').load(modalUrl).dialog('open');
  return false;
  }); 
coding_idiot
  • 13,526
  • 10
  • 65
  • 116
Sullan
  • 1,147
  • 2
  • 22
  • 39

2 Answers2

0

Ancient question, but there are a couple of very common culprits for this.

  1. The centering is done based on the content of the dialog when you open it. If you're adding the content after .open then that would explain top-level being in the center (because the div was emtpy originally).
  2. You may be missing some files from jquery-ui, or you may have jquery.dimensions.js which should NOT be in there. More info here: Dialog box not positions center screen
Community
  • 1
  • 1
Sean Colombo
  • 1,459
  • 17
  • 24
0

this works fine for me:

<script type="text/javascript" src="/js/jqueryui/jquery.ui.position.js"></script>

$(".Drive").dialog({ 
  position: ['center', 'center']
});
Floyd
  • 1,898
  • 12
  • 20