title: Pass arguments to afterclose callback on click of button in fancybox
body: <p>In the parent html page , when I click a link fancybox dialog opens up and I load a laravel php view page in that fancybox. </p>
  
  <p>When I press 'login with twitter' button in fancybox dialog, then I want to close the fancybox and redirect to a route(login/twitter) </p>
  
  <p>When I press 'login with facebook' button in fancybox dialog, then I want to close the fancybox and redirect to a route(login/facebook).</p>
  
  <p>To know where to route, I need to know which button is click in the afterClose callback function.</p>
  
  <pre><code>//parent.php
  
  $(".myDiag").fancybox({
          width       : 900,
          height      : 600,
          maxWidth    :"95%",
          padding     : 0,
          fitToView   : false,
          autoSize    : true,
          autoScale   : true,
          autoDimensions: true,
          closeClick  : false,
          openEffect  : 'none',
          closeEffect : 'none',
          afterClose : function(signupSource)
              {
                  if(signupSource)
                  {
                      window.location = "&lt;?php echo route('login'); ?&gt;" + "/" + signupSource;
                  }   
              }
      });
  
  //js in Fancybox.php
  
  
  $('#loginWithTwitter').click(funciton(){
      parent.$.fancybox.close('twitter');  // 'twitter' is not getting sent to the afterClose callback function
  });
  </code></pre>
  
  <p>How to pass the signupSource from Fancybox.php to parent.php?</p>