Skip to content

Instantly share code, notes, and snippets.

@mjones129
Created February 9, 2020 08:25
Show Gist options
  • Save mjones129/4dc9c242632edf86b0164ed8a8c84549 to your computer and use it in GitHub Desktop.
Save mjones129/4dc9c242632edf86b0164ed8a8c84549 to your computer and use it in GitHub Desktop.
capture how much a user has scrolled
//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