If you have a jQuery UI dialog and wanted to reset its position every time the dialog is re-opened, you can add custom function to reset its position in the open event. This can be useful if you use the close method to close the dialog instance and intend to re-use the dialog box without re-initializing it again, i.e: myCustomDialog.dialog("open"), as the instance is not removed and the next time you re-opened the dialog its last position will be retained to the position before you close the dialog box.

var myCustomDialog = $("#my-custom-dialog").dialog({
    autoOpen: false,
    modal: true,
    width: "auto",
    height: "auto",
    open: function(event, ui) {
      // Reset Dialog Position
      $(this).dialog('widget').position({ my: "center", at: "center", of: window });
    },
    buttons: {
        "Approve": function() {
            myCustomDialog.dialog("close");
        },
        "Reject": function() {
            myCustomDialog.dialog("close");
        },
        "Close": function() {
            myCustomDialog.dialog("close");
        }
    }
});