2

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
  • 4,492
  • 12
  • 50
  • 109

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
  • 3,391
  • 3
  • 31
  • 63