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-