Disable scrolling via dragging

Glydaysam

New Member
I would like to disable scrolling once a button is pressed. I already found this answer and it's really good - but the user is still able to scroll by marking something on the page and drag it to the top/bottom of the browser.This code resets the scroll position as quick as possible, but the scrolling is still visible (and this solutions appears a bit dirty)\[code\]var pageYOffset = window.pageYOffset;setInterval(function () { window.scrollTo(0, pageYOffset) }, 1);\[/code\]
 
Top