【发布时间】:2013-04-30 18:23:16
【问题描述】:
我的网站上有 Fancybox,例如这里,向下滚动到海洋探索照片库:
http://www.sea.edu/academics/oe
我已经在页面的测试版本中添加了 jQuery 选项卡,它可以正常工作,但是现在其中一个选项卡中的 FancyBox 无法正常工作。单击的图像在新窗口中打开。我猜 FancyBox 功能没有在选项卡中激活,但不知道如何修复它。查看非工作页面的示例,在“照片库”选项卡中包含画廊:
http://www.sea.edu/academics/oe_testing
这是在其他页面上工作的功能:
<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>
我已更改“_testing”页面以删除对不同版本的 jQuery 库的引用,但这并没有解决问题。经过一番搜索,我尝试更改为这个,仍然没有运气:
<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>
非常感谢任何建议!
【问题讨论】:
-
你能提供一个jsfiddle example吗?