Reputation: 474
I have a facebook application and i use fancybox. I want to close fancybox with following code but when user clicks the Close link, fancybox opens again. This code works at a non-facebook page.
<a href="#" onclick="parent.jQuery.fancybox.close();">Close</a>
Does anyone have idea how can i close the fancybox at a facebook canvas application?
Upvotes: 0
Views: 184
Reputation: 11054
I am guessing fancybox is tied to anchor tags, so your code closes it, but the event listener attached picks up the click and fires the open. Try using another tag to fire your close script:
<span onclick="parent.jQuery.fancybox.close();">Close</span>
If that works you can add styles to your span to give it the pointer cursor and otherwise make it look like a link if you want to.
Upvotes: 1