jQuery UI problem centering a dialog

Posted by marc on Stack Overflow See other posts from Stack Overflow or by marc
Published on 2010-05-25T17:30:07Z Indexed on 2010/05/25 17:31 UTC
Read the original article Hit count: 256

Filed under:

I've got a jQuery dialog box that does display and respond to button clicks correctly. Unfortunately it's always positioned at 0, 0 in the browser window despite my attempts to convince it otherwise. Any ideas?

    var $dialog = $('<div></div>')
  .html('my message')
        .dialog({ autoOpen: false, title: 'my title', position: 'center', bgiframe: true
        });

    $dialog.dialog('option', 'buttons', buttons);
    $dialog.dialog('option', 'position', "center");
    $dialog.dialog("open");

© Stack Overflow or respective owner

Related posts about jquery-ui