idmillington / undum

A client-side framework for narrative hypertext interactive fiction.
https://idmillington.github.com/undum
MIT License
336 stars 80 forks source link

Race condition layout error on http://idmillington.github.io/undum/ #56

Closed dfabulich closed 6 years ago

dfabulich commented 6 years ago

The Undum homepage sometimes has a layout error, especially when loading the site for the first time. The error occurs when jquery loads faster than the background image.

To reliably reproduce this issue in Google Chrome:

  1. Open an incognito window (with a fresh, empty browser cache).
  2. Navigate http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js to prime the browser cache for jquery.
  3. Open Chrome Dev Tools.
  4. Click the "Online" drop down and select a slower network speed, e.g. "Slow 3G." Make sure "Disable cache" is unchecked.
  5. Navigate to http://idmillington.github.io/undum/

The page layout will be incorrect. (See the attached screenshot.) The #content div will be set to 0 width and 0 height, because the image hasn't loaded when the resizer runs.

screen shot 2018-10-09 at 11 21 50 pm