Hi! I'm pretty new to the whole concept of preloading things with javascript, but it's really neat so I've started using it as much as I can.
On the front page of my web strategy game I have thumbnails of game screenshots. To keep the user from waiting for the fullsize images when viewing the screenshots I preload them with Js when the user arrives at the page. See www.metropolisonline.org. (So when the screen shot is clicked, the full size image is already loaded.)
Right now, the preload function runs on the bottom of the page. But then I thought, maybe this slows down the loading of other elements on the front page? Would it be better to put the preload function in the onload, ie <body onload="preloadscreenshotimages()", since this will load them AFTER all other information on the page? Or will other front page elements have priority since they come before the preload script on the page? Where would you prefer the preloading script to be executed?
On the front page of my web strategy game I have thumbnails of game screenshots. To keep the user from waiting for the fullsize images when viewing the screenshots I preload them with Js when the user arrives at the page. See www.metropolisonline.org. (So when the screen shot is clicked, the full size image is already loaded.)
Right now, the preload function runs on the bottom of the page. But then I thought, maybe this slows down the loading of other elements on the front page? Would it be better to put the preload function in the onload, ie <body onload="preloadscreenshotimages()", since this will load them AFTER all other information on the page? Or will other front page elements have priority since they come before the preload script on the page? Where would you prefer the preloading script to be executed?