You need to understand the difference between $ (document) .ready () and the normal load event (which is mainly related to $ (window) .load ()).
The document readiness event occurs when the entire document is ready to interact with JavaScript - all HTML and JavaScript are loaded. Most likely, not all images are uploaded, whether CSS is uploaded and applied are somewhat vague (browsers do this a little differently).
For these reasons, doing something that requires layout / size calculations from $ (document) .ready () is not a good idea. In this case, you will try to read the size of the document before all the images are loaded, so that you get the size, as well as before the browser knows what size it will be when it knows the size of all the images.
Itβs better to work in Opera if Iβm sure that this is done at boot time, and not document.ready.
(Another problem is that Opera does not load images inside the display: none content - until you actually change the display so that the images are needed. This improves download performance, but sometimes means that the user has to wait for images to load when additional content shown in the figure.)
source share