Jquery Fancybox画廊群
我正在使用fancybox,我的问题是: 我可以把不同的资源组合在一起吗?我指的是在同一个图库(或“组”)中具有内联或视频的图像。如果是,有人知道怎么做吗 下面是一个不起作用的示例:Jquery Fancybox画廊群,jquery,fancybox,Jquery,Fancybox,我正在使用fancybox,我的问题是: 我可以把不同的资源组合在一起吗?我指的是在同一个图库(或“组”)中具有内联或视频的图像。如果是,有人知道怎么做吗 下面是一个不起作用的示例: <a class="fancyinline" data-fancybox-group="testgroup" href="#cont3">Test</a> <div class="fancyhidden" id="cont3">Test Content</div> &
<a class="fancyinline" data-fancybox-group="testgroup" href="#cont3">Test</a>
<div class="fancyhidden" id="cont3">Test Content</div>
<a class="fancyimage" data-fancybox-group="testgroup" href="test.jpg" >
<img src="test-th.jpg" alt="" />
</a>
测试内容
fancyinline和fancyimage没有组合在一起,但我需要这样。
当然,我需要不同的参数为内联线和图像
提前感谢。要对fancybox中的导航元素进行分组,需要在每个元素上设置
rel
属性。
相同的rel
值将告诉fancybox,如果其中一个被打开,所有这些都将出现在导航中
看到这个了吗
集体示例
HTML
<a rel="example_group" title="Custom title" href="full_path_to_image.jpg">
<img alt="" src="path_to_image_thumbs.jpg">
</a>
<a rel="example_group" title="Custom title" href="full_path_to_image.jpg">
<img alt="" src="path_to_image_thumbs.jpg">
</a>
<a rel="group2" title="Custom title" href="full_path_to_image.jpg">
<img alt="" src="path_to_image_thumbs.jpg">
</a>
<a rel="group2" title="" href="full_path_to_img.jpg" style="display:none;"></a>
<a rel="group2" title="" href="full_path_to_img.jpg" style="display:none;"></a>
<a rel="group2" title="" href="full_path_to_img.jpg" style="display:none;"></a>
组示例一可见,其余部分隐藏 HTML
<a rel="example_group" title="Custom title" href="full_path_to_image.jpg">
<img alt="" src="path_to_image_thumbs.jpg">
</a>
<a rel="example_group" title="Custom title" href="full_path_to_image.jpg">
<img alt="" src="path_to_image_thumbs.jpg">
</a>
<a rel="group2" title="Custom title" href="full_path_to_image.jpg">
<img alt="" src="path_to_image_thumbs.jpg">
</a>
<a rel="group2" title="" href="full_path_to_img.jpg" style="display:none;"></a>
<a rel="group2" title="" href="full_path_to_img.jpg" style="display:none;"></a>
<a rel="group2" title="" href="full_path_to_img.jpg" style="display:none;"></a>
我是这样做的
$("#fancybox-manual-c").click(function() {
$.fancybox.open([
{
href : '1_b.jpg',
title : 'My title'
}, {
href : '2_b.jpg',
title : '2nd title'
}, {
href : '3_b.jpg'
}
], {
helpers : {
thumbs : {
width: 75,
height: 50
}
}
});
});
我知道这一点,它适用于图像组。我需要“异构”组(图像、视频或内联线都在同一组中)。我在我的帖子上加了一个例子。