I'm uploading a gallery of images via AJAX with fancybox so I also need to put the thumbnails in this gallery how should I proceed?
Return from my JSON:
["title": "caption 1 .....", "href": "553e2ec2a7be4.jpg"}, {"title": "caption 1.", "href": "553f7d3c4bed5.jpg "}, {" title ":" caption 1 "," href ":" 553f7d4924889.jpg "}, {" title " ":" caption 1 "," href ":" 553f7d6459659.jpg "}]
My JS
$('#maisAlbuns').on('click', function(event){
event.preventDefault();
$.getJSON( "/fotos/3", function( data ) {
$.fancybox(data,[
{
helpers: {
thumbs: {
width: 40,
height: 40,
source: function (current) {
return $(current.element).data('href');
}
}
}
}]);
});
});