I am facing a challenge with my jQuery modal dialog. While it is loading properly, I am restricted to using an older version of jQuery (1.12.4) and cannot upgrade it. My goal is to center the modal close to the top of the page, similar to how it is positioned in this example. Currently, I am utilizing the code below with the position: ['center',20], which almost achieves the desired positioning except for the fact that my outdated jQuery version is causing issues. I am seeking alternative solutions or suggestions from anyone who can help.
$('#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");
}
}
});
});
Unfortunately, in my case, the modal is loading on the top left corner as shown in this image.