This is the time between rendering an element and executing your JS code. A way to avoid this does not put the code in the DOM-ready event, but right after the element:
<div id="whatever">...</div> <script>$('#whatever').hide();</div>
Anything else, such registration event handlers can, of course, still work in your DOM-ready function.
Oh, and you donβt have to use visibility - show() and hide() will use the display property anyway.
If the item you want to hide is a "enable JavaScript" warning, consider using <noscript>...</noscript> - then it will never appear if JS is not disabled.
Thiefmaster
source share