Reputation: 271734
$('a.post_ext_img').colorbox({
photo: true,
transition: 'none'
});
I am using this plugin: http://jacklmoore.com/colorbox/
Is there a way to make it so that when user clicks the photo, it closes it?
Upvotes: 1
Views: 1971
Reputation: 1038780
I don't think that the plugin provides an option for this. So you could subscribe to the click event of the image and trigger the close
method manually:
$('a.post_ext_img').colorbox({
transition: 'none',
photo: true,
onComplete: function(result) {
$('.cboxPhoto').click(function() {
$(this).unbind('click');
$.colorbox.close();
});
}
});
And here's a live demo.
Upvotes: 2