1

Is there a (reliable) way to distinguish between scroll event initiated by mousewheel versus when user uses browser scrollbar or scrolls by touch? If I add this event I get true in both cases.

document.on('scroll', function(){

});
Toniq
  • 3,918
  • 9
  • 42
  • 96

1 Answers1

1

You could detect the mouse wheel: Answer equivalent: - Mousewheel event in modern browsers - List item

window.addEventListener("wheel", event => console.info(event.deltaY));
Steve Tomlin
  • 2,480
  • 3
  • 22
  • 39