gpt4 book ai didi

javascript - 如何使用 lightbox-0.5 在一页中添加两个画廊

转载 作者:行者123 更新时间:2023-12-03 06:39:28 25 4
gpt4 key购买 nike

如何使用 lightbox-0.5 在一页中添加两个画廊 我的代码在 the jsfiddle

<div id="thumbnails">
<ul class="clearfix">

<li><a href="http://thumb9.shutterstock.com/display_pic_with_logo/64681/296369042/stock-photo-common-modern-business-skyscrapers-high-rise-buildings-architecture-raising-to-the-sky-sun-296369042.jpg" title="Travancore Opus Highway Apartments" rel="lightbox"><img src="http://thumb9.shutterstock.com/display_pic_with_logo/64681/296369042/stock-photo-common-modern-business-skyscrapers-high-rise-buildings-architecture-raising-to-the-sky-sun-296369042.jpg" alt="turntable"></a></li>
<li><a href="http://thumb1.shutterstock.com/display_pic_with_logo/64681/296369060/stock-photo-sun-reflecting-in-a-usual-modern-business-skyscraper-high-rise-building-architecture-raising-to-296369060.jpg" title="Travancore Opus Highway Apartments" rel="lightbox"><img src="http://thumb1.shutterstock.com/display_pic_with_logo/64681/296369060/stock-photo-sun-reflecting-in-a-usual-modern-business-skyscraper-high-rise-building-architecture-raising-to-296369060.jpg" alt="turntable"></a></li>
</ul>
</div>

请帮忙..

最佳答案

你必须写两个单独的<ul>的元素

例如:

    <!-- one set of images -->
<ul class="gallery1">
<li><a href="image2.jpg" rel="lightbox"><img src="thumb2.jpg"></a></li>
<li><a href="image3.jpg" rel="lightbox"><img src="thumb3.jpg"></a></li>
<li><a href="image4.jpg" rel="lightbox"><img src="thumb4.jpg"></a></li>
</ul>
<!-- another set of iamges -->
<ul class="gallery2">
<li><a href="image2.jpg" rel="lightbox"><img src="thumb2.jpg"></a></li>
<li><a href="image3.jpg" rel="lightbox"><img src="thumb3.jpg"></a></li>
<li><a href="image4.jpg" rel="lightbox"><img src="thumb4.jpg"></a></li>
</ul>

编辑:

也使用下面的 javascript 。

$(function() {

$('.gallery1 a[rel*=lightbox]').lightBox();
$('.gallery2 a[rel*=lightbox]').lightBox();
});

关于javascript - 如何使用 lightbox-0.5 在一页中添加两个画廊,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38028083/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com