tags:

views:

25

answers:

1

Hi,

I have made an image gallery. What currently happens is the following.

I display all of the thumbnails, each thumbnail has a unique identifier. I then use an ajax request to look up the page and the image that matches the thumbnail.

At this point I use jQuery to switch the src value in the #photo div. On my localhost this provides seemless changes between images.

On a live site the effect is obviously not as smooth. How can I display an image only after it has been loaded?

+3  A: 

You can preload images and show them:

Preloading images using jquery

Krunal