I\'m using fancy box to create a popup and load another page on it using an iframe. here is my code
This is an old thread but I thought I'd share my two cents.
I was having similar issues with closing the fancybox iframe using the onclick event and after many tries, this did the trick for me: window.parent.jQuery.fancybox.close()
Here's an example using an input button:
As well, I tested the onlick on an anchor (a) tag and it worked fine.