Search code examples
jquerycolorbox

Closing the Colorbox when clicking on its image


I've got a colorbox which closes nicely with:

$.colorbox.close();

I also closes when clicking on the overlay, but I'd like to close it when clicking on the image. Were can I add the call to that close function?


Solution

  • I would simply do this:

    $('img').click(function() {
        $.colorbox.close();
    });