456543646346
456543646346

Reputation: 993

Close fancybox from iframe

I have a Fancybox that opens a contact form from an iframe. Inside the iframe, i have a close button but it's not working.

I have tryed both with $.fancybox.close(); and parent.jQuery.fancybox.close();

What am I doing wrong ?

Upvotes: 0

Views: 7031

Answers (2)

Syuaa SE
Syuaa SE

Reputation: 1681

The problem is you are trying to execute parent windows js function with different host name ( its not allowed ). Try access you site without www. ( this is because your contact button using fancy from url without www. )

Upvotes: 1

Kundan Singh Chouhan
Kundan Singh Chouhan

Reputation: 14282

As per http://fancybox.net/api Try this instead :

parent.$.fancybox.close();

Upvotes: 9

Related Questions