title: FancyBox custom close button
body: <p>I want to set up buttons types that can close the window, so I made wrote this code:</p>
  
  <pre><code>$(".fstandard").fancybox({
      afterClose: function() {
          alert("Closed!");
      },
      afterShow : function() {
          $(':button').click(function() {
              $.fancybox.close();
          })
      }
  });
  </code></pre>
  
  <p>I tried in vain several other codes, but none of them worked, the window does not close. This line gives me an error:</p>
  
  <pre><code>$.fancybox.close(); 
  </code></pre>
  
  <blockquote>
    <p>$.fancybox is undefined</p>
  </blockquote>
  
  <p>I use FancyBox v2.0.3. In their documentation, it is well presented to close the window: <a href="http://fancyapps.com/fancybox/#support" rel="nofollow">http://fancyapps.com/fancybox/#support</a></p>
  
  <p>Thanks in advance</p>