0

Context

Lets say We are on this page and we attach a scroll event listener to the window.

document.body.addEventListener("scroll",(e)=>console.log("scroll fired"))

Now there are two ways to trigger the event, one is user scrolling and other one being window.scroll(X,Y).

Problem

So, is it possible to find (in event handler) whether the user, or the computer(DOM API), triggered the event?

Please pardon if I asked something lame. Thanks!

ref-

deepanshu
  • 625
  • 5
  • 15

0 Answers0