ciao a tutti!
ho una pagina formata da diversi elementi di interfaccia, tutte JPG (ca 250K tot, già compressi sigh), che dovrebbero essere precaricati PRIMA di mostrare la pagina all'utente. Ho provato a scrivere questa banale funzione, ma non fa ciò che vorrei:
function init()
{
var bottom=new Image();
bottom.src="image/bottom.jpg";
var bottom_left=new Image();
bottom_left.src="image/bottom_left.jpg";
var bottom_right=new Image();
bottom_right.src="image/bottom_right.jpg";
var left=new Image();
left.src="image/left.jpg";
var left_repeat=new Image();
left_repeat.src="image/left_repeat.jpg";
var right=new Image();
right.src="image/right.jpg";
var right_repeat=new Image();
right_repeat.src="image/right_repeat.jpg";
if(bottom.complete && bottom_left.complete && bottom_right.complete && left.complete && left_repeat.complete && right.complete && right_repeat.complete){}
}
e nel tag BODY ho messo onLoad="init()", sperando che lanciasse init() al caricamento prima di mostrarmi il contenuto del sito..
avete suggerimenti da darmi?
grazie mille
ciao!