Created
February 9, 2020 08:25
-
-
Save mjones129/4dc9c242632edf86b0164ed8a8c84549 to your computer and use it in GitHub Desktop.
capture how much a user has scrolled
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
//converts scroll data to +1 or -1 and prints to the console | |
window.addEventListener("wheel", event => { | |
const delta = Math.sign(event.deltaY); | |
console.info(delta); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment