views:

114

answers:

1

Like I said, IE7 (and IE6 but I don't really care IE6 that much) doesn't position dialog properly on window resize. When window is re sized, dialog goes down and down. IE8 FF Chrome Safari all work properly and position and re size dialog just fine but IE7 it re sizes the dialog but positions incorrectly. Anybody know some fix about this?

$("#mydialog").dialog({
    autoOpen: false,
    bgiframe: true,
    resizable: false,
    modal: true,
    title: "",
    height: 400,
    overlay: {
        backgroundColor: '#000',
        opacity: 0.5
    }
});
$(window).resize(function(){
    $('#mydialog').dialog("option", "height", $(window).height() - 40);
    $('#mydialog').dialog('option', 'position', 'center');
});
$("#mydialog").dialog("open");
+1  A: 

Ok here is a workaround I found, it's a bit slow but it works.

$(window).resize(function(){
    $('#mydialog').dialog("option", "height", $(window).height() - 40);
    $('#mydialog').dialog('option', 'position', 'center');
    if ($.browser.msie && parseInt($.browser.version) <= 7) {
        $('#dialog_checkout').dialog('close');
        $('#dialog_checkout').dialog('open');
    }
});
Ergec