gpt4 book ai didi

javascript - swiper - 如何禁用嵌套的水平滑动器进一步滚动(边缘触摸释放)?

转载 作者:行者123 更新时间:2023-12-05 07:46:13 27 4
gpt4 key购买 nike

当我尝试构建一个嵌套的 swiper 时,外部的 swiper 就像一个组织我页面的选项卡 View ,而内部的 swiper 是一个计划选择工具,供您查看可用的计划。

但是,swiper 有一个特点,当内部 swiper 用完元素时,它会导致外部 swiper 滑动。但是我不想要这种行为。

我查了几个小时的 API,找到一个 touchReleaseOnEdges 属性,但它不起作用,谁能给我一些想法?

查看 jsfiddle 链接 https://jsfiddle.net/fdyuestc/eoyceaLL/

var swiper = new Swiper('#outer', {
pagination: '#outer1',
slidesPerView: 4,
centeredSlides: true,
paginationClickable: true,
spaceBetween: 30
});
var swiper = new Swiper('#inner', {
pagination: '#inner1',
slidesPerView: 1,
centeredSlides: true,
paginationClickable: true,
spaceBetween: 30,
nested:true,
touchReleaseOnEdges: false
});

最佳答案

toEdge 事件可能会有用。

关于javascript - swiper - 如何禁用嵌套的水平滑动器进一步滚动(边缘触摸释放)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40998897/

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