title: Fancybox.close() on an iframe
body: <p>i am using the latest fancybox (2.0.4) and i created a fancybox for an iframe. the content is displayed correctly. i add a "close" button to my html which is displyed within the iframe. i wish that the close button will have the same result as clicking the "x" on the right top corner of the fancybox. i am familiar with <a href="https://stackoverflow.com/questions/2227096/fancybox-iframe-returns-parent-as-undefined-using-wordpress">FancyBox iframe returns parent.$ as undefined (using WordPress)</a>, and my <code>parent</code> is a DOM object with nothing in it. also tried</p>
  
  <pre><code>window.parent.jQuery.fancybox.close();
  window.parent.jQuery.fn.fancybox.close();
  parent.jQuery.fn.fancybox.close();
  parent.jQuery.fancybox.close();
  </code></pre>
  
  <p>any help?</p>
  
  <p>UPDATE:</p>
  
  <h1>a.js (linked to the a.html)</h1>
  
  <pre><code>$(document).ready(function() {
      $(".fancybox").fancybox({
          maxWidth    : 800,
          maxHeight   : 600,
          fitToView   : false,
          width       : '70%',
          height      : '70%',
          autoSize    : false,
          closeClick  : false,
          type        : 'iframe',
          openEffect  : 'none',
          closeEffect : 'none',
          afterClose  : function() { 
              window.location.reload();
          }
      });
  });
  </code></pre>
  
  <h1>a.html</h1>
  
  <pre><code>&lt;a class="fancybox fancybox.iframe" id="newLink" href="new.html"&gt;link&lt;/a&gt;
  </code></pre>
  
  <p>how can i have a button within <code>new.html</code> that closes the fancybox iframe window</p>
  
  <p>UPDATE: a complete html files</p>
  
  <h1>a.html</h1>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  "http://www.w3.org/TR/html4/strict.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt;
          &lt;script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"&gt;&lt;/script&gt;
          &lt;link rel="stylesheet" href="fancybox/jquery.fancybox.css?v=2.0.4" type="text/css" media="screen" /&gt;
          &lt;script type="text/javascript" src="fancybox/jquery.fancybox.pack.js?v=2.0.4"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
              $(document).ready(function() {
                  $(".fancybox").fancybox({
                      maxWidth    : 800,
                      maxHeight   : 600,
                      fitToView   : false,
                      width       : '70%',
                      height      : '70%',
                      autoSize    : false,
                      closeClick  : false,
                      type        : 'iframe',
                      openEffect  : 'none',
                      closeEffect : 'none',
                      afterClose  : function() { 
                          window.location.reload();
                      }
                  });
              });
          &lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;a class="fancybox fancybox.iframe" id="newLink" href="b.html"&gt;link&lt;/a&gt;
  
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <h1>b.html</h1>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  "http://www.w3.org/TR/html4/strict.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt;
          &lt;script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"&gt;&lt;/script&gt;
          &lt;link rel="stylesheet" href="fancybox/jquery.fancybox.css?v=2.0.4" type="text/css" media="screen" /&gt;
          &lt;script type="text/javascript" src="fancybox/jquery.fancybox.pack.js?v=2.0.4"&gt;&lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;input type="submit" value="Cancel" id="cancelBtn" onclick="parent.jQuery.fancybox.close()"/&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>