I’m making a simple gallery, which uses simple javascript for changing
‘src’ attrbiute of ‘img’ element.
How to wait for an image to be downloaded completely before trying to
display it and while browser downloads this image display a spinner gif
or ‘please wait’ message etc.?
This should work, but I haven’t had cause to try it… Load the
high-res image into a hidden img tag, whose onload handler swaps the
spinner’s src attribute for its own. Alternatively, if you’ve got
control over the images, you could be polite to your users and use an
interlaced file format. Not as Web2.0, but much, much cleaner.