Created
March 6, 2018 11:39
-
-
Save Lysindr/e815cc1ec02f9afc09db8ccdaddc0a84 to your computer and use it in GitHub Desktop.
Disable user SCROLL on animate: scrollTop()
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
$('html, body').on("scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove", function () { | |
$('html, body').stop(); | |
}); | |
$('html, body').animate({ | |
scrollTop: $('.news-full').offset().top | |
}, 600, function() { | |
console.log('popa'); | |
$('html, body').off("scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment