Look at this example: and look at another one: Differences are minimal: in the first case I just invoke window.getComputedStyle(document.body) without getting property, and in the second case I doing it with width property. As a result in first one we don’t see recalculation styles and reflows but in the second one we see vesa versa situation. Why? Answer This
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