JQuery (document). no longer waiting for the readiness of the DOM

I have a very subtle animation in the title. When you first load the page or refresh using cmd + shift + r (mac) to clear the cache, jQuery really does not wait until the DOM is ready. It starts the animation before regular html / css appears.

I just don’t understand what exactly (the document). does it really do?

+5
source share
1 answer

DOMContentLoaded fires when the DOM is ready, but this does not necessarily mean that all CSS and images are loaded. If you want this, the best option would be$(window).on('load',function(){...});

+6
source

All Articles