Skip to content
Advertisement

Tag: reflow

Is there a way to detect horizontal scroll only without triggering a browser reflow

You can detect a browser scroll event on an arbitrary element with: I would like to be able to differentiate between vertical scrolling and horizontal scrolling and execute actions for them independently. I’m currently doing this by stashing the values of element.scrollTop, and element.scrollLeft, and then comparing them inside the event listener. E.g. This works fine, however from https://gist.github.com/paulirish/5d52fb081b3570c81e3a I

Advertisement