0

I'm creating a gallery of images with a thumbnail strip below. I would like to preload these images so that when the user clicks a thumbnail, the image immediately appears. There are quite a few photos though, so I don't want to wait until all images are preloaded until the user is able to click on a thumbnail. How do I allow for the images to load in the background, while allowing the user to click on a thumbnail and that photo appearing?

Here is the page for reference: http://tinyurl.com/lk6e2yx

1 Answers1

0

If you use jQuery for example you can do something like

jQuery(document).on("click", "IMG.thumbnail", function(event){ ... });

That would enable the handler for any element matching now or future with the selector.

Edorka
  • 1,781
  • 12
  • 24