I am trying to display a Fancybox gallery with data that gets loaded via JSON. I was able to get the Fancybox to load properly after I load in and append the new HTML. However, when I attached rel="somegroup" the gallery functionality doesn't work and I cannot iterate through the group of images from the Fancybox.
Here's my fancybox call:
$('.fancyness').live('click', function(){
$.fancybox(this, {
'width' : 'auto',
'height' : 'auto',
'titleShow' : true,
'titlePosition' : 'over'
});
return false;
});
And here is what the images look like:
html += '<li><a class="fancyness" rel="group" href="' + full + '" title="'+ title +'">';
html += '<img title="' + item.title + '" src="' + thumbnail + '" alt="' + item.title + '" /></a></li>';
If I don't use .live the gallery (rel) function will work correctly but not on this data because this is being loaded in with JSON.
Does anyone have any ideas? I haven't had much luck finding anyone else with a similar issue.
Thank you.
$('A[rel=group]').fancybox({
- Changing the Fancybox to this allows the group to open, however, it adds the same image to the list of images in the group at the last index, so the image is in there twice. Is there anyway to get around the extra image? – Anna