Hi everyone,
I have a jquery colorbox application.In this application,When i click a link,a jquery colorbox modal box opens and it contents come from external link.There is a button inside of the content and i want to close colorbox window when i click that button.Is there any way to close colorbox modal window?There is colorbox's own closing button but i dont want to use that because my application needs a button in order to close it.
I used $.fn.colorbox.close();
when click button but it didn't work.
Thanks for advance...
views:
297answers:
1
+1
A:
Try attaching a jQuery live event to the button. Assuming you add a button with class closebutton
to the color box content:
$('#cboxContent .closebutton').live('click', function(){
$.fn.colorbox.close();
});
fudgey
2010-07-18 15:57:58
I put it in the external content page but it didn't work
cubuzoa
2010-07-18 16:41:20
It should be added to the main page, not the external content page. External content javascript is automatically disabled by jQuery.
fudgey
2010-07-18 17:43:38