1

I want to trigger Colorbox event on clicking Close button and overlay close but it's not working:

$('#cboxClose').on('click', function() {
alert("Click button");
});

$("cboxOverlay").on('click', function() {
alert("Click overlay");
});
1
  • 1
    Please post your html markup and the whole script function. And $("cboxOverlay") is a wrong selector.
    – Shaunak D
    May 27, 2014 at 4:47

1 Answer 1

8

Use colorbox onClosed callback. See documentation: http://www.jacklmoore.com/colorbox/

$(".popuplink").colorbox({

                href: popupurl,

                close: "Close",

                overlayClose: true,

                onComplete: function () {

                    alert("Completed");

                },
                onClosed: function () {

                    alert("Closed");

                }

            });
1
  • You're welcome. Please tick it as a correct answer if it solved your problem.
    – Code.Town
    May 28, 2014 at 0:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.