I am trying to add Image count in a Featherlight Gallery. Example : Image 1 of 6 (somewhere beside/below an image)
$.featherlightGallery.prototype.afterContent = function(){
var object = this.$instance,
target = this.$currentTarget,
parent = target.parent(),
caption = parent.find('.wp-caption-text'),
galParent = target.parents('.gallery-item'),
jetParent = target.parents('.tiled-gallery-item');
$('<div class="count">Image ' + (currentNavigation() + 1)+' of ' + slides().length + '</div>').html(object.find('.featherlight-content'));
if (0 !== galParent.length) {
caption = galParent.find('.wp-caption-text');
} else if (0 !== jetParent.length) {
caption = jetParent.find('.tiled-gallery-caption');
}
object.find('.caption').remove();
if (0 !== caption.length) {
$('<div class="caption">').text(caption.text()).appendTo(object.find('.featherlight-content'));
}
}
It throws me back with the error : currentNavigation is not defined
Omg! I got it! I guess it was a fluke! After trying a few probabilities, this is the final answer. I hope someone may find this useful ;D