Hi,
I have two identical sets of images: the first set is 80x80 pixels, the second set is 320x320 pixels.
What I want to do is display a thumbnail image (80x80), then when you click on the thumbnail, it loads the large image (320x320) in another container on the page.
If I use the 320x320 images as thumbnails (display them sized as 80x80), this works well because they are already cached once the page has loaded. However, if I use the 80x80 as thumbnails, when I load the click the image and try to load the 320x320, I end up with no image. If I click a second time, the image appears as it has completed loading.
I have got this working using Ajax, but would rather do it without using Ajax (as I have been told not to).
Anyone have any idea how to do this? I am guessing that I could display an animated gif whilst doing a loop in the background to check if the image has loaded.
By the way, I can't use lightbox or any other JS framework. Very restrictive!
I have two identical sets of images: the first set is 80x80 pixels, the second set is 320x320 pixels.
What I want to do is display a thumbnail image (80x80), then when you click on the thumbnail, it loads the large image (320x320) in another container on the page.
If I use the 320x320 images as thumbnails (display them sized as 80x80), this works well because they are already cached once the page has loaded. However, if I use the 80x80 as thumbnails, when I load the click the image and try to load the 320x320, I end up with no image. If I click a second time, the image appears as it has completed loading.
I have got this working using Ajax, but would rather do it without using Ajax (as I have been told not to).
Anyone have any idea how to do this? I am guessing that I could display an animated gif whilst doing a loop in the background to check if the image has loaded.
By the way, I can't use lightbox or any other JS framework. Very restrictive!