Forked from syuichi-tsuji/gist:ea387588c834bcc23c96
Created
February 23, 2018 12:51
-
-
Save e1blue/0c576a7f6fce0f8bd40c4caa9074c6f8 to your computer and use it in GitHub Desktop.
スクロールイベント 上下方向の判定
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
| var start_pos = 0; | |
| $(window).scroll(function(e){ | |
| var current_pos = $(this).scrollTop(); | |
| if (current_pos > start_pos) { | |
| console.log('down'); | |
| } else { | |
| console.log('up'); | |
| } | |
| start_pos = current_pos; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment