On my album slide show page, i have code like
<span style="display:none;">
<img id="id1" src="~$imageUrl`" onload="javascript:showImage();">
</span>
<span>
// show loader.
</span>
in showImage()
, i am sure the image is loaded, so i show the image and hide the loader.
Now when user clicks on next, i need to change the src of the image. Now i need don't know how to set src only when image is loaded.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…