JOAOSANTACRUZ.COM

Preload Images

Preload images using javascript, allows to load images before display any page content. This code should be in the begining of the page.


						

function preloadImages() {

	
var namesImagesToPreload = new Array( );

namesImagesToPreload[0]= '/temas/default/imgs/menu_pt/
bt01_on.gif';
namesImagesToPreload[1]= '/temas/default/imgs/menu_pt/
bt02_on.gif';
namesImagesToPreload[2]= '/temas/default/imgs/menu_pt/
bt03_on.gif';
namesImagesToPreload[3]= '/temas/default/imgs/menu_pt/
bt04_on.gif';


for($k=0;$k<
namesImagesToPreload.length;$k++){
image = new Image();
image.src = namesImagesToPreload[$k];
}

}
preloadImages();


Go Back