jQuery Lightbox 单图显示
有没有办法让灯箱只显示单击的图像而不显示整个图库。 我不想让用户能够看到除了他们单击的图像之外的其他图像,但文档似乎没有反映这一功能。
任何帮助或示例将不胜感激。
Is there a way to make lightbox only show the image clicked on and not show an entire gallery.
I am not interested in giving the user the ability to see other images aside from the one they clicked on, but the documentation doesn't seem to reflect this functionality.
Any help or examples would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试将其添加到您的 CSS 中:
Try adding this to your CSS:
您可以隐藏导航,如另一个答案中所述
但一个不错的解决方案是单独初始化每个项目上的灯箱插件。
您可以这样做,而不是
$('#gallery a').lightBox();
:图库实际上是由适合选择器的每个项目组成的,
如果您选择 10 个项目,这些项目将成为您的图库,但如果您分别在每个项目上启动
.lightBox()
,它们都会被添加到自己的图库中(当只有 1 个项目被选中时,插件会隐藏控件)在画廊中。)请参阅此处的示例:
http://jsfiddle.net/saelfaer/kwdBf/
you can hide the navigation as explained in another answer here
but a nice solution is to initialize the lightbox plugin on each item separately.
instead of
$('#gallery a').lightBox();
you can do this:the gallery is actually made of each item that fits the selector,
if you select 10 items those will be your gallery, but if you launch
.lightBox()
on each separately, they each get added to their own gallery (convenientely the plugin hides the controls when only 1 items is in the gallery.)see an example here:
http://jsfiddle.net/saelfaer/kwdBf/