将所有图像链接添加到站点上的颜色框

时间:2011-12-12 08:42:55

标签: jquery gallery colorbox

我正在使用colorbox:http://www.rheolas.com/tsalapeng

我想将其设置为自动将页面上的所有彩盒链接添加到一组,以便您可以使用左侧箭头浏览它们。

我该怎么做?

2 个答案:

答案 0 :(得分:1)

为anchor-tag指定相同的类名,并使用rel参数调用colorbox,如下所示:

$(".classname").colorbox({rel:'classname'});

答案 1 :(得分:1)

您需要在colorbox的设置中添加rel。

所以而不是

jQuery('a.gallery').colorbox({ opacity:0.5,  maxWidth:"90%", maxHeight:"90%"});

你需要做类似

的事情
jQuery('a.gallery').colorbox({ opacity:0.5,  maxWidth:"90%", maxHeight:"90%", rel:"group1" });