0

I've gone through so many solutions etc... to this problem and still no further forward. My problem here is that every time the dialog opens in fire fox, it isn't centered. My code is as follows:

$("#dialog").dialog({
    autoOpen: false,
    position: {
        my: "center",
        at: "center",
        of: window,
        collision: "fit",
        // Ensure the titlebar is always visible
        using: function( pos ) {
            var topOffset = $( this ).css( pos ).offset().top;
            if ( topOffset < 0 ) {
                $( this ).css( "top", pos.top - topOffset );
            }
        }
    },
    modal: true,
    draggable: false,
    resizable: false
});

$("#addnew").click(function(event) {
    $("#dialog").dialog('open');
    event.preventDefault();
});

I don't know where it's going wrong here. The only other thing is I've got an IFrame in the dialog div but that shouldn't have any bearing on anything should it?

Any help would be great!

Dave
  • 45
  • 7
  • I think this might be the same question as this: [other so post][1] [1]: http://stackoverflow.com/questions/1839702/how-can-i-position-my-jquery-dialog-to-center – Chris Jun 03 '13 at 03:08
  • I ended up having to revert back to version 1.6 of JQuery to get it to work so it's clearly a bug. – Dave Jun 03 '13 at 23:21
  • http://stackoverflow.com/questions/1467102/dialog-box-not-positions-center-screen – ratm Mar 17 '17 at 16:37

0 Answers0