I was experimenting with some images of large file sizes to be used in a gallery. I'm trying to do this in the most simple way possible. Here I am using just a few example images:
var imageGallery = ["nebula.jpg", "galaxy.jpg", "blackHole.jpg"];
for (var i = 0; i < imageGallery.length - 1; i++) {
var img = new Image();
img.src = imageGallery[i];
}
I understood that this code would make sure the images are cached before being used by the rest of the script, but it's not working.
Help would be appreciated.