Michael Scharnagl is a freelance front-end developer. He loves learning new things and finding techniques that challenge what we think is best practice, all with progressive enhancement in mind. You can find his writing on his blog, and follow him on Twitter @justmarkup.
Have you ever opened a website, started reading and, after some time had passed and all assets had finished loading, you found that you’ve lost your scroll position? I undergo this every day, especially when surfing on my mobile device on a slow connection — a frustrating and distracting experience.
Every time the browser has to recalculate the positions and geometries of elements in the document, a reflow happens. This happens when new DOM elements are added to the page, images load or dimensions of elements change. In this article, we will share techniques to minimize this content shifting.