maintain dialog center with dynamic content

Posted by mcgrailm on Stack Overflow See other posts from Stack Overflow or by mcgrailm
Published on 2010-04-30T13:52:42Z Indexed on 2010/04/30 14:57 UTC
Read the original article Hit count: 321

I would have a dialog with the following

$("#statusbox").dialog({
        autoOpen: false,
        bgiframe: true,
        modal: true,
        width: 'auto',
        height:'auto',
        title:"Check Order Status",
        buttons: {
            Find: function() {
                get_status();
            },
            Close: function() {
                $(this).dialog('close');
            }
        }
    });

and when the user hits the find button it runs ajax and returns orders to the dialog and it get dynamically re-sized but it only extends the box down. Is there way to make the box extend up and down so that the dialog remains centered ?

also if there was enough content then it could potentially go beyond the bounds of the page so I would think I could use a max height to prevent that but what do I do if they re-size the window ?

thanks for any help

© Stack Overflow or respective owner

Related posts about jquery-ui-dialog

Related posts about jQuery