开发者

closing jquery colorbox modal window when clicking specific button which exists in the content came from external link

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 $.开发者_JS百科fn.colorbox.close(); when click button but it didn't work. Thanks for advance...


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();
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜