<script type="text/javascript">
$.ajaxSetup({
cache: false
});
$(document).ready(function () {
$(".openDialog").live("click", function (e) {
e.preventDefault();
$("<div></div>").addClass("dialog").attr("id", $(this).attr("data-dialog-id")).appendTo("body").dialog({
title: $(this).attr("data-dialog-title"),
minWidth: 500,
minHeight: 100,
resizable: false,
close: function () {
$(this).remove()
},
modal: true
}).load(this.href);
});
$(".close").live("click", function (e) {
e.preventDefault();
$(this).closest(".dialog").dialog("close");
});
$(".refresh").live("click", function (e) {
e.preventDefault();
location.reload();
});
});
</script>
i am using above jquery to get dialog box. but when the dialog box is shown it appears in the random part of the window which is very uncomforting. I want to make the dialog box appear in the center of the window. What should I do to make dialog box appear in center of the window?
From jQueryUI dialog documentation:
So have you tried the variant with the exact position?