怎么在左右滑动时,阻止页面滚动呢
nanzm opened this issue · comments
neil commented
这个swiper 在页面中间 ,怎么优雅的处理 用户想要滚动和swiper切换的问题呢?望老哥回复
leeenx commented
@YuanTU 这个组件应该是处理了左右滑动和页面滚动的问题。阻止页面滚动是在touch事件中添加preventDefault
。可以看一下:https://github.com/leeenx/mobile-swiper/blob/master/mobile-swiper.js#L11
这一行是处理页面滚动和swiper切换的交互的。如果您希望的效果是页面既可以上下滚动,swiper 同时可以左右滚动的话,那么页面的滚动要使用第三方 js 库来管理(例如: iscroll)