Last active
February 1, 2017 11:38
-
-
Save wokalek/8a55adfe49a35022677dba4f1ec11701 to your computer and use it in GitHub Desktop.
Cansel scroll on flag
This file contains 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
// Stack scroll by flag | |
function ScrollControll(flag) | |
{ | |
if (flag) | |
{ | |
scrollTop = $(window).scrollTop(); | |
scrollLeft = $(window).scrollLeft(); | |
$(window).on('scroll mousewheel', function(event) | |
{ | |
event.preventDefault(); | |
event.stopPropagation(); | |
$(window).scrollTop(scrollTop); | |
$(window).scrollLeft(scrollLeft); | |
}); | |
} | |
else | |
{ | |
$(window).off('scroll mousewheel'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment