Skip to content

Instantly share code, notes, and snippets.

@codesburner
Forked from avhm/iosPreventScroll.js
Created April 4, 2011 10:35
Show Gist options
  • Save codesburner/901450 to your computer and use it in GitHub Desktop.
Save codesburner/901450 to your computer and use it in GitHub Desktop.
iOsScrollingToggle : function(enabled){
function preventScroll(e){
e.preventDefault();
e.stopPropagation();
}
// This should prevent people from scrolling away from the modal window without closing it
if(enabled){
document.body.removeEventListener('touchmove',preventScroll,false);
} else {
document.body.addEventListener('touchmove',preventScroll,false);
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment