intImage = 2; function swapImage(first, second) { switch (intImage) { case 1: intImage = 2 document.getElementById("img1").src = first return(false); case 2: intImage = 1 document.getElementById("img1").src = second return(false); } }
it is just a simple swapImage...basically you click on a smaller image and the larger one loads.
The problem is that sometimes the larger image takes some time to download and there is no activity indicator and for some reason javascript has to load the whole image before it will show it...unlike just loading an image normally (without js) when the image loads from top to bottom and you can see it loading.
So what I would like to do is have the image load normally without having to preload in js. If that is really difficult then a simple gif animated activity indicator while the image is loading to show that something is happening.
Which approach is easiest and how would I go about it.
Any help would be fantastic...I am quite the javascript noob so please forgive any lack of the right vocab or general ignorance in the above.