This little snippet is being posted because of extreme frustration in trying to find the answer for how to close a fancybox window with a link or button.  Hopefully this little tid-bit will help you out.

How to close Fancybox from an Iframe:

 

<button onclick=”parent.jQuery.fancybox.close();”>Close</button>

And it will look like this:


or for a textual link:
<a href=”#” onclick=”parent.jQuery.fancybox.close();”>Close</a>

This Post Has 7 Comments

  1. Dd

    Thanks for this!!! Looked all over.

  2. DoubleVroar

    Thanks! Very helpful!

  3. Great

    You saved my day! Thank you very much!

  4. izzy

    Man, it only took me two hours to find this. Thanks for posting this!

  5. Noum77

    Me too. Thank bro.

  6. ghent

    Thank you for this information, it really help me a lot. ^_^

  7. Antonio

    Thanks a lot!!

Leave a Reply

Get in Touch

Please fill out the form below and we will get back to you ASAP