Is it possible to have a loading.gif displayed when my iframe is loaded?
I managed to do this using some code I came across here: Displaying a loading gif while iframe content loads
However, there is a new issue on my website. I have checkboxes and radio buttons that change the source of the iframe and refresh it when selected. Unfortunately, the loading symbol only appears when the entire page reloads, not when the iframe switches its source and undergoes a refresh. How can I resolve this problem?
<style>
#loadImg{position:absolute;z-index:999;}
#loadImg div{display:table-cell;width:950px;height:633px;background:#fff;text-align:center;vertical-align:middle;}
</style>
<div id="loadImg"><div><img src="loading.gif" /></div></div>
<iframe border=0 name=iframe src="html/wedding.html" width="950" height="633" scrolling="no" noresize frameborder="0" onload="document.getElementById('loadImg').style.display='none';"></iframe>
Solution courtesy of Jay, view full response here