Triggering those two events in the DOM ready handler causes the layout to be invalidated, and this added a lot of loading time (it created layout race condition when trying to read the two nav content width). Doing so in the load event makes sure that the layout will be valid. If you want, I can show you the Chrome timeline's data to show you what I mean.