https://en.wikipedia.org/wiki/Flash_of_unstyled_content
It's happening only on my title screen, when the styles are loaded. Of course it's very annoying, and there are plenty of ways to prevent it with Javascript (not tested yet). But is there a proven way to load content after the CSS, a "proper" way to do it? Thank you.
Comments
The following, equivalent, code would probably be better:
Or maybe my logic is affect by insomnia...
Continuing under that assumption. You code is not executed by Harlowe until after its main entry function, which it passes to jQuery as a ready callback, is called. Meaning that your two ready callbacks are redundant—yes, two, see below*. By the time your code is executed by Harlowe and adds your ready callbacks the state required for them to be called already exists, so they're called as soon as you add them. There is no point in using ready callbacks within Story JavaScript code.
The code I gave an example of before was a counter example, not using redundant callbacks. The outer function, which is immediately called, is simply there to keep the global scope clean, it's not strictly necessary and the code would work without it. For example: For that matter, using your original code without the pointless ready callbacks would also work. For example: That's actually fairly similar to mine, save that it uses an effects queue delay and an animated show, whereas mine uses a standard timeout and a non-animated show.
* jQuery's ready callbacks have several syntaxes, two of which are: Both of the functions you supply in your original example are used as ready callbacks.