Forum Moderators: open
var photos = new Array();
photos[0] = "001";
photos[1] = "002";
photos[2] = "003";
photos[3] = "004";
photos[4] = "005";
photos[5] = "006";
photos[6] = "007";
photos[7] = "008";
photos[8] = "009";
photos[9] = "010";
photos[10] = "011";
photos[11] = "012";
photos[12] = "013";
photos[13] = "014";
photos[14] = "015";
photos[15] = "016";
photos[16] = "017";
photos[17] = "018";
photos[18] = "019";
photos[19] = "020";
for (i=0;i<photos.length;i++)
{
function photoReplace() {
document.img.photo.src = "images/gallery/2007/2007_" + photos[i] + ".jpg";
}
document.write("<td><a onclick='photoReplace()'><img src='images/gallery/2007/thumbs/2007_" + photos[i] + "_thumb.jpg' /></a></td>");
}
}
I've got one much question if you'll indulge me. I'm noticing that it can take a few seconds to get the full-size image loaded and displayed if it's not already in the cache. I don't want to slow the load time of the page initially to load the images into the cache, so I'm wondering if there's an easy way to utilize some kind of "loading" image, like the spinning line circle I've seen elsewhere. I imagine this is an AJAX thing, but I'm still just trying to get the basics of Javascript down. Could you point me in the right direction? If not, I'm still really grateful for the help you've given me so far.