Jump to content

image swap, loading


djp1988

Recommended Posts

I've got a grid of thumbnails, and one large image on a page, when I click an thumbnail, I do an ajax call to get some info and the full path to large image, then I swap the src attribute of the large image with the new path, but while the image loads the old image is still being shown.How can I detect a new image is "loading" and therefor put a loading gif over the image or next to it, as it stands the user experience is a little confusing.All I can find on google is preloading images, which isn't really what I needThanks

Link to comment
Share on other sites

when you make the AJAX call, can you just change the src of the image or something near it to indicate the new image is "loading"? i.e., making the AJAX call. Just make it the first thing that happens.Then just use the response status to change it to the new picture.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...