I'm facing an issue where a button on my HTML page triggers a popup box to open (which covers the background). To prevent the background from scrolling, I am using the following CSS:
windowHeight = $(window).height();
$("body").css({
"height": windowHeight,
"overflow": "hidden",
"overflow-y": "hidden"
});
While everything is functioning correctly, the page automatically scrolls to the top when the button is clicked. How can I avoid this from happening?