title: How do I globally handle onClose event of fancybox?
body: <p>I am using Fancybox in my application. Now to handle the close event we write something like:</p>
  
  <pre><code>$(".fancybox").fancybox({onClose:function(){alert('blah');}}
  </code></pre>
  
  <p>as seen on this doc page:</p>
  
  <p><a href="http://fancyapps.com/fancybox/#docs">http://fancyapps.com/fancybox/#docs</a></p>
  
  <p>However I want to write something common and global to all fancybox that gets run everytime for any of the fancybox. How do I do that? In short I don't want to write the code of onClose on each fancybox and don't want it to be dependent upon class,id (Eg. <code>.fancybox</code> in this case). How do I do that? I tried to write:</p>
  
  <pre><code>$.fancybox({onClose:function(){alert('blah');}}
  </code></pre>
  
  <p>but it doesn't work and from the docs it looks like this is the function for opening progammatically.</p>