I have Fancybox working on my site, example here, scroll down to Ocean Exploration Photo Gallery:
http://www.sea.edu/academics/oe
I've added jQuery tabs to a testing version of the page, got that working, but now the FancyBox within one of the tabs isn't working. The clicked image opens up in a new window. I'm guessing the FancyBox function isn't getting activated in the tab, but can't figure out how to fix it. See example of non-working page, with the gallery in the Photo Gallery tab:
http://www.sea.edu/academics/oe_testing
Here is the function that works on other pages:
<script type="text/javascript">
$(document).ready(function() {
$("a[rel=fancygallery]").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>';
}
});
});
</script>
I've changed the "_testing" page to remove references to different versions of the jQuery library, which didn't fix the problem. After some searching around, I tried changing to this, still no luck:
<script type="text/javascript">
$("#OEtabs-3").each(function() {
$("a[rel=fancygallery]").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>';
}
});
});
</script>
Any advice greatly appreciated!