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 );
hi i am a novice and just know html and css a lil bit. i tried some solutions on the web but couldnt figure out how to tweak them according to my project and i hope this may work as it is not specified to some predefined classes. so could you plz tell the procedure to use it? like,
for example i have a class .overlay which is hidden by default and when i click on on an anchor tag which is targeted to a div having the class .overlay and an id to get targeted and a modal opens i want to disable the body from scrolling when modal is opened.
sorry for asking an annoying question.