Using jQuery, I would like to disable scrolling of the body:
My idea is to:
body{ overflow: hidden;}
One liner to disable scrolling including middle mouse button.
$(document).scroll(function () { $(document).scrollTop(0); });
edit: There's no need for jQuery anyway, below same as above in vanilla JS(that means no frameworks, just JavaScript):
document.addEventListener('scroll', function () { this.documentElement.scrollTop = 0; this.body.scrollTop = 0; })
this.documentElement.scrollTop - standard
this.body.scrollTop - IE compatibility