title: Fancybox 1.3.4 automatically close
body: <p>I have a dynamically filled Fancybox that is used for address standardization. If no addresses are returned, I want to cancel the Fancybox call automatically. I have tried both of the following with no success: </p>
  
  <pre><code>$.fancybox.close();
  parent.$.fancybox.close();
  window.parent.$.fancybox.close();
  $.fancybox.cancel();
  </code></pre>
  
  <p>This is the call I am doing to bring the page up:</p>
  
  <pre><code>$.fancybox({
                  'autoDimensions': true,
                  'autoScale': false,
                  'centerOnScroll': false,
                  'scrolling': 'no',
                  'enableEscapeButton': false,
                  'hideOnOverlayClick': true,
                  'href': 'url for page',
                  'showCloseButton': false,
                  'onStart': function() {
                      $.fancybox.showActivity();
                       },
                  'type': 'inline'//had issues with iframe
              });
  </code></pre>
  
  <p>The JSP that is loaded into the fancybox window will show the loading activity, but if the server returns null, it will not fully close the fancybox. So far I can get the fancybox to close everything except for the overlay and the content divs. Below is what is being used to call the automatic close:</p>
  
  <pre><code>function closeDynamic() { 
      alert("2222");
      $.fancybox.cancel();
  }
  </code></pre>
  
  <p>Then calling the closeDynamic function at the bottom of the page.</p>