I made an image gallery with multiple albums each album containing different number of photos. I am trying to get two fancybox behavior
Req 1 - Clicking on the primary image of the album opens up a fancy box and navigates through the primary images of all albums. I got this part working
Req 2 - Beneath every album I have an anchor tag which displays the count of photos in the album. When I click on this anchor tag, fancy box should navigate through the photos of that particular album only. I am not sure how to bind this anchor tag to the trigger fancybox and navigate through the images in the album. I have a static json file and i have two attributes primaryPhoto
and imagesContained(array)
.
Could someone please help me with how to get through this?
$.each(data.gallery,function(i,item) {
$.each(item.albums, function(i,photos) {
imageFolder = sec.mediumUrl;
imgInsert += '<a href="' + photos + '" class="grouped_elements" rel="Gallery' + count + '" class="big_img"' +'">';
});
'<a href="' + imgThumb + '" class="description2" title="Hello world">' + count + '</a></div>';
count++;
});
I am trying to access it like this
$("a.description2").click(function() {
$("a.grouped_elements").fancybox({
'transitionIn': 'none',
'transitionOut': 'none',
'titlePosition': 'over',
'titleFormat': function (title, currentArray, currentIndex, currentOpts) {
return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' ' + title : '') + '</span>';
}
});
});