PDA

View Full Version : image loading priority



Johnnymushio
10-23-2006, 12:25 PM
is there a code that gives a certain image a priority over others when a page is loading?

i want a certain image to load first, for slower computers.

Twey
10-23-2006, 01:22 PM
You can preload images:
function preloadImages() {
for(var i = 0; i < arguments.length; ++i)
(preloadImages.store[preloadImages.store.length] = new Image()).src = arguments[i];
}
preloadImages.store = [];

preloadImages("importantImageOne.png", "importantImageTwo.jpg");