title: Closing an iframe after it has reloaded another html page
body: <p>I have made the following site:</p>
  
  <p><a href="http://www.ppp.one" rel="nofollow">www.ppp.one</a></p>
  
  <p>Whenever you open an image, a popup is loaded.</p>
  
  <p>This popup can be closed using the <code>X</code> on the top-right. However, if you click on one of the thumbnails in the popup (reloading the frame) the <code>X</code> button can no longer close it.</p>
  
  <p>The JavaScript I use:</p>
  
  <pre><code>function hide(){
  
      if(currentIframe){
          currentIframe.hide();
          currentIframe = null;
      }
  
      popupBG.remove();
      popup.remove();
  }
  </code></pre>
  
  <p>And the html:</p>
  
  <pre><code>&lt;a class="small align-top" onclick="frameWarp.hide();"&gt;&amp;#10006&lt;/a&gt;
  </code></pre>
  
  <p>Any ideas on what is causing the issue?</p>