title: Using afterClose event with Fancybox3
body: <p>How can I create an afterclose event with FancyBox3? I'm using afterClose event with the second version of fancybox but i'm trying to upgrade to fancybox3 and the instructions say to put the options in &quot;data-options&quot; attribute.</p>
  <p>Here's what i tried:</p>
  <pre><code>  &lt;a data-fancybox data-type=&quot;iframe&quot; data-src=&quot;http://www.example.com&quot; href=&quot;javascript:;&quot;
       data-options='{
                     
                  afterClose  : function() {
                      location.href = &quot;http://www.google.com&quot;;
                  }
                     }'&gt;
  </code></pre>
  <p>and also:</p>
  <pre><code>&lt;script&gt;
          $(&quot;[data-fancybox]&quot;).fancybox({
      afterClose  : function() {
                      location.href = &quot;http://www.google.com&quot;;
                  }
  
          });
  &lt;/script&gt;
  </code></pre>