Matt Hintzke
Matt Hintzke

Reputation: 7984

How to force image to load first

I have a photo gallery which, depending on the number of pictures, can take some time to load. I have a .gif loading image that I have set to appear while the gallery is loading. However, for some reason the .gif itself takes many seconds to appear on the screen.

How can I force the .gif to load before other images on the page so that the "loading" image is seen by the user right off the bat?

Here is the site Photo Gallery

Upvotes: 0

Views: 2694

Answers (2)

Blazemonger
Blazemonger

Reputation: 92893

The size of your images is the entire problem. The background, the full-size photos, it all adds up to a mess of bandwidth. Even on broadband it takes too long because there's so many images that have to be downloaded separately.

Replace your giant background with two small PNGs and use small thumbnails for the actual gallery. Your problem will disappear.

Upvotes: 1

Phillip Schmidt
Phillip Schmidt

Reputation: 8818

Step 1: Ajax call to load the gif

Step 2: Load the rest in the ajax callback

Upvotes: 1

Related Questions