gpt4 book ai didi

javascript - 从链接中删除点击事件并恢复默认行为

转载 作者:行者123 更新时间:2023-11-28 04:33:56 24 4
gpt4 key购买 nike

我正在使用一组图像通过插件构建图库。我想添加最后一组作为点击更多链接,如下所示。

enter image description here

<div id="lightGallery" class="row no-gutter venue-photo-list" data-rel="venue-photos">
<div class="col-xs-4 col-md-2" data-title="Nomad" data-desc="Travel the World like a Nomad" data-src="images/venues/venue-medium.jpg"> <a href="javascript:void(0)"> <img src="images/venues/venue-medium.jpg" alt=""> </a> </div>
<div class="col-xs-4 col-md-2" data-title="Nomad" data-desc="Travel the World like a Nomad" data-src="images/venues/venue-medium6.jpg"> <a href="javascript:void(0)"> <img src="images/venues/venue-medium6.jpg" alt=""> </a> </div>
<div class="col-xs-4 col-md-2" data-title="Nomad" data-desc="Travel the World like a Nomad" data-src="images/venues/venue-medium2.jpg"> <a href="javascript:void(0)"> <img src="images/venues/venue-medium2.jpg" alt=""> </a> </div>
<div class="col-xs-4 col-md-2" data-title="Nomad" data-desc="Travel the World like a Nomad" data-src="images/venues/venue-medium3.jpg"> <a href="javascript:void(0)"> <img src="images/venues/venue-medium3.jpg" alt=""> </a> </div>
<div class="col-xs-4 col-md-2" data-title="Nomad" data-desc="Travel the World like a Nomad" data-src="images/venues/venue-medium4.jpg"> <a href="javascript:void(0)"> <img src="images/venues/venue-medium4.jpg" alt=""> </a> </div>
<div class="col-xs-4 col-md-2" data-title="Nomad" data-desc="Travel the World like a Nomad" data-src="images/venues/venue-medium5.jpg"> <a href="javascript:void(0)"> <img src="images/venues/venue-medium5.jpg" alt=""> </a> </div>
<div class="col-xs-4 col-md-2 more-photos"> <a href="http://google.com">More</a> </div>
</div>

当我单击该按钮时,我想重定向到另一个页面并绕过图库插件事件。知道如何强制点击吗?

Link

最佳答案

您可以取消绑定(bind)父 div 上的当前事件处理程序,允许链接点击通过:

$('div.more-photos').off('click');

关于javascript - 从链接中删除点击事件并恢复默认行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24590278/

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