我坚持以下几点:
我正在使用 iDangerous Swiper 插件,它工作正常。但是,我也想在同一个 iDangerous swiper 上使用 jQuery 的点击功能。
例如:
<div id="swiper-container">
<div class="swiper-slide">(lots of stuff here)</div>
<div class="swiper-slide">(lots of stuff here)</div>
<div class="swiper-slide">(lots of stuff here)</div>
<div class="swiper-slide">(lots of stuff here)</div>
</div>
和 :
$('.swiper-slide').click(function() {
//more functionality here
}
问题是,滑动滑块也会触发 jquery .click。这有点糟糕,因为在我的情况下 .click 中的函数会加载另一个页面。
使用纯 html 链接虽然有效。然而,这并不能解决我的问题,因为我希望下一页不可见地加载(而不在 url 栏中加载)。
有谁知道在使用滑块时如何防止触发上述 jQuery 代码?
提前致谢 :)