Stop Page Scroll

I put something together that seems to be working for me. I am using this javascript in the trigger javascript workflow action

$(document).ready(function(){
$(“#page”).css(“height”,“100px”);
$(“#page”).css(“overflow-x”,“hidden”);
});

This is done when my overlay group that blurs the background of page and displays a loading wheel (you can use overlay groups to act like popups but takes a bit of effort) is visible. This effectively stops the page from scrolling and interestingly doesn’t cut the content off…I can see the full content of according to the browser height.

Then when the overlay group is not visible I run this javascript.

$(document).ready(function(){
$(“#page”).css(“height”,“1240px”);
$(“#page”).css(“overflow-x”,“hidden”);
});

My page in the editor is built to be 1240px in height, so this is setting it to its original value. I am using this on a search results page with repeating groups that have dynamic heights. What is interesting is as the height of the repeating group increases, the javascript setting page height doesn’t stop the page from increasing accordingly.

This has effectively gotten my page to stop scrolling as my repeating groups are loading results from the search.

Still would be nice to just have a simple workflow though and really be no-code.