ComputerUser
ComputerUser

Reputation: 4878

jQuery - Load images in a gallery?

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?

Upvotes: 1

Views: 697

Answers (1)

Krunal
Krunal

Reputation: 3541

You can preload images and show them:

Preloading images using jquery

Upvotes: 2

Related Questions