Last active
August 29, 2015 14:18
-
-
Save adikahorvath/0c632a00c8ed03b48701 to your computer and use it in GitHub Desktop.
disable/enable scrolling on mobile devices
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// disable | |
document.ontouchmove = function(e){ e.preventDefault(); } | |
$('body').bind('touchmove scroll mousewheel', function(e){ | |
e.preventDefault(); | |
}); | |
// enable | |
document.ontouchmove = function(e){ return true; } | |
$('body').unbind('touchmove scroll mousewheel'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment