Skip to content

Instantly share code, notes, and snippets.

@Efetivos
Last active November 5, 2023 15:57
Show Gist options
  • Select an option

  • Save Efetivos/544fd80b4c36a45395ec5c4044992423 to your computer and use it in GitHub Desktop.

Select an option

Save Efetivos/544fd80b4c36a45395ec5c4044992423 to your computer and use it in GitHub Desktop.
['wheel', 'DOMMouseScroll'].forEach(evt =>
window.addEventListener(evt, function (evt) {
var dir = Math.sign(evt.deltaY);
if (dir < 0) {
console.log(dir)
}
else if (dir > 0) {
console.log(dir)
}
}, false)
);
/* -------------- MOUSE WHEEL---------------- */
$(window).bind('mousewheel DOMMouseScroll', function(event){
if (event.originalEvent.wheelDelta > 0 || event.originalEvent.detail < 0) {
tlSlide.reverse()
}
else {
tlSlide.play()
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment