Fancybox 将图像添加到图库
我正在一个网站上工作,其中显示了一个项目的 3 个图像,但一个项目的图像可能超过 3 个。我想使用 fancybox 来显示它们,但我不知道如何完成。
我知道如何“手动”创建图库,但我不知道如何手动将图像添加到由类标识的现有图库中。
谢谢。
I'm working on a site, where I have 3 images of an item displayed, but there are can be more than 3 images of an item. I want to use fancybox to display them, but I couldn't figure out how it could be done.
I know how to create a gallery "manually", but I don't know how to add images manually to an existing gallery which is identified by a class.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Fancybox 中似乎没有任何方法可以通过编程方式将图像添加到图库中。也许您可以联系作者并请求,或者您可以修改脚本。
It doesn't look like there are any methods in Fancybox for programatically adding an image to a gallery. Perhaps you could contact the author and request it, or you could modify the script.
每次添加新图像时,您都需要重新创建 fancybox 库。正如 simshaun 所说,没有方法可以将新图像添加到现有的 fancybox 画廊中。
从 Fancybox 示例页面 中,您需要在每个图像上具有相同的
ref
参数为了创建画廊。You will need to recreate the fancybox gallery each time you add a new image. As simshaun said, there is no method for adding new images to an existing fancybox gallery.
From the Fancybox example page, you need to have the same
ref
parameter on each image in order to create the gallery.这应该可以工作,因为图像将在那里并添加到 fancybox 中,但只是不显示。
This should work as the image will be there and added to the fancybox but just not shown.