gpt4 book ai didi

javascript - 如何打开第二个灯箱

转载 作者:行者123 更新时间:2023-11-28 03:19:02 25 4
gpt4 key购买 nike

有没有办法在内部打开第二个灯箱?目前,按照我打开的方式,它打开到彼此的顶部。

我想做的与此类似; /image/6crh7.jpg

这是我的代码;

.product1 {display: none}
.product2 {display: none}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/featherlight/1.5.0/featherlight.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/featherlight/1.5.0/featherlight.min.css" rel="stylesheet"/>
<a href=".product1" class="" data-featherlight>See product detail</a>

<div class="lightbox product1">
<h1>Product name</h1>
<p><b>Description:</b></p>
<p>Nulla vitae elit libero, a pharetra augue. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Aenean lacinia bibendum nulla sed consectetur.</p>
<br><br>
<p><b>Related products:</b></p>
<a href=".product2" class="" data-featherlight>Click Me</a>
</div>

<div class="lightbox product2">
<h1>Product name</h1>
<p><b>Description:</b></p>
<p>Nulla vitae elit libero, a pharetra augue. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Aenean lacinia bibendum nulla sed consectetur.</p>
</div>

最佳答案

我已将 featherlight.js 内的 beforeOpen: $.noop, 更改为 beforeOpen: function() { $.featherlight.close() }, 并且成功了。

关于javascript - 如何打开第二个灯箱,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59360397/

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