I have a simple popup (not an Iframe) where a user can send mail to each other. There is a submit button to send the information and a cancel button which should close the overlay.
I do have some trouble getting the close button to work.
The code looks like this:
<asp:Button runat="server" ID="btnCancel" Text="Cancel" />
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery("#<%= btnCancel.ClientID %>").click(function () {
jQuery.colorbox.close(); return false;
});
});
</script>
I have tried with both parent.jQuery.colorbox.close(), jQuery.fn.colorbox.close() but with no success.
Does your colorbox have a close button at the top. [close]. In my application when i want to introduce a cancel button to close the colorbox window from a link other than already provided by colorbox.
I do a workaround like.
jQuery('#cboxClose').click();
this will click the default close button and will eventually close the colorbox.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With