Mittwoch, 11. Juni 2008

preload(images, counter)

function preload(images, counter, max) {
if(counter < max) {
for(var i = 0; i < images.length; i++) {
if(images[i].complete == true) {
counter += 1;
} else
}

document.write(counter + ' von ' + max + ' wurden bereits geladen.');
window.setTimeout(function() { preload(images, counter, max) }, 10);
} else {
document.write('Alle Bilder wurden erfolgreich geladen.');
}
}

Keine Kommentare: