帮助为灯箱中同一页面上的多个链接创建单独的画廊
我正在尝试从灯箱中的链接打开图像库,我已经掌握了基础知识,并且我有一个可以打开图像库的链接,但我想在页面上打开 6 个不同的链接每一张都有不同的图像库,当我设置它时,它不显示图库,只显示一张图像。有没有办法复制这个:
HTML
<div id='gallery'>
<a href="images/big-image1.jpg">
<img src="images/thumbnail-image1.jpg"/>
</a>
<a href="images/big-image2.jpg" ></a>
<a href="images/big-image3.jpg" ></a>
<a href="images/big-image4.jpg" ></a>
</div>
JS
$(document).ready(function() {
$('#gallery a').lightBox();
});
每个设置的 ,并让它们工作?我需要为它们分配不同的 div 名称才能使它们工作吗?
谢谢,杰西卡
I am trying to make a gallery of images open from a link in a lightbox, I have the basics down, and I have one link that opens a gallery of images, but I have 6 different links on the page that I want to open a different gallery of images for each one, when I set it up it does not display the gallery, only one image. Is there a way to duplicate this:
HTML
<div id='gallery'>
<a href="images/big-image1.jpg">
<img src="images/thumbnail-image1.jpg"/>
</a>
<a href="images/big-image2.jpg" ></a>
<a href="images/big-image3.jpg" ></a>
<a href="images/big-image4.jpg" ></a>
</div>
JS
$(document).ready(function() {
$('#gallery a').lightBox();
});
for each set-up, and have them work? Do I need to assign them different div names to make them work?
Thanks, Jessica
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您有六个不同的 div,则必须调用 jQuery Lightbox 插件六次:
另一种选择是只有一个 div,并且每个图像都有一个 rel 标记属性以将它们分组到画廊中:
HTML
然后使用此脚本(您仍然需要运行六次):
If you have six different divs, you'll have to call the jQuery Lightbox plugin six times:
Another option would be to just have one div and each image have a rel tag attribute to group them into galleries:
HTML
then use this script (you'll still have to run it six times):