how to disable onscroll="" with css code example
Example 1: disable scroll css
/* Answer to: "disable scroll css" */
/*
You must set the height and overflow of the body, to disable
scrolling.
*/
html, body {
margin: 0;
height: 100%;
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(){};
}