Last active
August 29, 2015 13:57
-
-
Save mizchi/9888031 to your computer and use it in GitHub Desktop.
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
watchMomentumScrolling = ($el) -> $.Deferred (d) => | |
last = $el.scrollTop() | |
do watcher = => | |
setTimeout => | |
current = $el.scrollTop() | |
if last is current | |
d.resolve() | |
else | |
last = current | |
do watcher | |
, 16 | |
$wrapper = $('.wrapper') | |
$wrapper.on 'touchend', -> | |
watchMomentuScrolling($wrapper).done -> console.log 'momentum scrolling done' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment