Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function logScrollDirection() {
- var previous = window.scrollY;
- window.addEventListener('scroll', function(){
- window.scrollY > previous ? console.log('down') : console.log('up');
- previous = window.scrollY;
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement