A lot of JavaScript libraries have user interface widgets.
Usually they are created after the page is loaded. The user sees a page re-flow and parts of the page shift around or change appearance.
How can I reduce the amount of reflowing that occurs when a page loads, especially if I’m using several widgets?
Here’s some examples. These are really basic so the reflow isn’t so bad, but it’s there, especially with a cleared cache and a slow Internet connection:
- YUI 3: The main paragraph shifts down after the menu nav element loads.
- BBC Glow: The logos load as a vertical list and then change to a Carousel control.
- YUI 2: The table appears plain and then suddenly changes appearance.
- jQuery DataTables Plugin: The whole table appears, plain, before being restyled and paginated.