I have a jQuery modal dialog that is loading perfectly fine but my issue is that I am using little old version of jQuery(1.12.4) and I cannot upgrade it and I want to center the modal close to the top of the page like I have it in this Fiddle. I am using the below code to make it work and position: ['center',20], is making it close to the top but again since I am using an old version of the jQuery it is not working for me. Can someone suggest any other alternaate.
$('#open').click(function() {
$('#dialog').dialog('open');
});
$(document).ready(function() {
jQuery("#dialog").dialog({
autoOpen:false,
width:500,
position: ['center',20],
modal: true,
resizable: true,
draggable: true,
closeOnEscape: true,
title: "Alerts",
buttons: {
OK: function () {
$(this).dialog("close");
}
}
});
});
In my case loading on the top left corner as shown below
question from:
https://stackoverflow.com/questions/65851459/change-modal-dialog-to-load-close-to-top-of-the-page 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…