I have a website that utilizes AJAX to load content dynamically. To enhance user experience, I implemented an overlay with a loading indicator during the loading process using jQuery and the jQuery BlockUI plugin.
When invoking $(element).block(), everything functions as expected. However, the issue arises when additional content is loaded onto the page - the overlay shifts down along with it, resulting in a less-than-ideal appearance. My goal is to have the overlay cover the entire visible area of the page right from the start. One solution would be to set a large height value for the overlay like so:
$(myElement).block({
overlayCSS: {
height: '10000px'
}
});
Unfortunately, this approach introduces a scrollbar. How can I prevent this and ensure that the overlay remains the perfect height to cover the visible page without altering its size?