Useful for when a blocking user experience is needed (in my case, didn't want people unwittingly loosing their place by scrolling while a modal required their attention): $.scrollLock()
locks the body in place, preventing scroll until it is unlocked.
// Locks the page if it's currently unlocked
$.scrollLock();
// ...or vice versa
$.scrollLock();
// Locks the page
$.scrollLock( true );
// Unlocks the page
$.scrollLock( false );
Thanks a lot for this wonderful library. It worked flawlessly. I had been trying for so long to hide scrolling on body while a pop-up window appears on ios, you have saved a lot of my time. Very much appreciated. I really recommend it. For those who are dealing with such issue I really recommend you to use this one it works on ios devices too.