how to disable page scrolling javascript code example
Example 1: javascript disable scrolling on body
document.body.style.overflow = 'hidden';
Example 2: javascript disable scrolling
function disableScrolling(){
var x=window.scrollX;
var y=window.scrollY;
window.onscroll=function(){window.scrollTo(x, y);};
}
function enableScrolling(){
window.onscroll=function(){};
}