I am developing ASP.NET 4.0
application runs in Facebook App. I'am using jQuery FancyBox
to show some PopUps. I can easily show modal, but when I try to close or try to handle which button (Yes/No) clicked, problems occur. Searched many sites, found many solutions, but nothing changed. For example, this is code which I use to show modal
This is HTML Part
<div id="uyariIki" class="uyariModal">
<table width="100%" border="0" cellspacing="0" cellpadding="15">
<tr>
// Some Mesages here
</tr>
<tr>
<td align="center" valign="middle"><a class="modalTamam-button" href="#" onclick='$.fancybox.close'>Tamam</a></td>
</tr>
</table>
</div>
I used different codes on onclick event such as
$.fancybox.close()
OR
parent.jQuery.fancybox.close();
OR
parent.$.fancybox.close();
But these are didnt work. When I hit "Tamam" button, LightBox is closing and suddenly showing again like an infinite loop or postback.
I also tried to close it from Javascript such as:
function CloseFancyBox() {
$("#uyariIki").fancybox().trigger('close');
}
But ofcourse this one also didnt work :)
Checking http://fancybox.net/api to see options, $.fancybox.close
is located in this site. But its not working.
So, how can I close FancyBox
, when I click "Tamam" button on FancyBox Modal
Second question is; How can I handle which button pressed (Yes/No)? (I can provide codes of this modal)
I can provide another information if needed. Thanks.