When using the dialog plug-in, the screen is centered by default. However, when the scroll bar appears on the page, the dialog does not scroll down with the scroll bar. At this time, the user needs to slide the scroll bar to position the dialog. This is not humane. Before coming up with the solution, let’s popularize several jquery positioning methods
//Get the height of the browser display area
$(window).height();
//Get the width of the browser display area
$(window).width();
//Get the document height of the page
$(document.body).height();
//Get the document width of the page
$(document.body).width();
//Get the vertical height of the scroll bar to the top
$(document).scrollTop();
//Get the vertical width of the scroll bar to the left
$(document).scrollLeft( ; Call the panel's move function to move the dialog
$("#dlg").panel("move",{top:$(document).scrollTop() ($(window).height()-250 ) * 0.5});
where $(window).height()-250, where 250px is the width of the dialog.