Closed ash73 closed 3 years ago
You got it. Colorbox elements have predictable selectors. How about this:
$(document).bind('cbox_complete', function(){
var title = document.getElementById('cboxTitle');
var filename = document.querySelector('.cboxPhoto');
if (title && filename) {
console.log(title.innerText, filename.src.split('/').pop());
}
});
That's perfect! Works just fine, many thanks for the quick reply.
Hi, noob question, not an issue... is it possible to get the title or filename of the image displayed in the colorbox popup, after the cbox_complete event? I want to log which images are viewed.
By popup I mean the full size picture displayed with left/right arrows when the user clicks on a thumbail.
$(document).bind('cbox_complete', function(){ var picture_title = document.getElementById(???).?????; var picture_filename = ???; });