title: Show loading symbol when iframe gets loaded AND changes its source?
body: <p>I want to display a loading.gif when my iframe gets loaded.</p>
  
  <p>I did that with the code I found here: <a href="https://stackoverflow.com/questions/12136788/show-a-loading-gif-while-iframe-page-content-loads">Show a loading gif while iframe page content loads</a></p>
  
  <p>This works. But on my website,  I have checkboxes and radio buttons. When the user clicks on one of them, the iframe changes it's source and gets refreshed. The problem is, that the loading symbol is only visible when the whole page loads, not when the iframe changes it's source and get's refreshed. How can I fix that?</p>
  
  <pre><code>&lt;style&gt;
  #loadImg{position:absolute;z-index:999;}
  #loadImg div{display:table-cell;width:950px;height:633px;background:#fff;text-align:center;vertical-align:middle;}
  &lt;/style&gt;
  &lt;div id="loadImg"&gt;&lt;div&gt;&lt;img src="loading.gif" /&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;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';"&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>code from Jay, <a href="https://stackoverflow.com/questions/12136788/show-a-loading-gif-while-iframe-page-content-loads">view full answer here</a></p>