Resize page after all images are loaded

Wai Park Soon
NoteToPS
Published in
1 min readJan 18, 2013

It’s quite a common practice for jQuery users to encapsulate their code in $(document).ready(); that it guarantees the codes inside are executed after the page’s DOM structure is constructed.

However, if you have some images and need to do some DOM adjustment based on them, $(document).ready() might not suffice. Instead, use $(window).load(); that is fired after everything is loaded.

There are a few catches on this kind of usage anyway, that are stated on the documentation.

--

--