We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如何才能横向滚动时锁定页面纵向滚动事件呢?现在翻着翻着页面就跑了……
The text was updated successfully, but these errors were encountered:
我也遇到了这个问题,请问你是怎么解决的呢?
Sorry, something went wrong.
看了一下源码, 我是这么解决的,在 onTouchMove 回调函数里,判断滑动距离小于设备高度或宽度的一半,抛出一个异常, 虽然感觉不太优雅,但好歹能解决问题了,哈哈。
onTouchMove (weswiper, event) { const { XORY } = weswiper const touch = event.changedTouches[0] const distance = touch[`client${XORY}`] const tmpMove = distance - weswiper[`touchStart${XORY}`] if (Math.abs(tmpMove) <= (weswiper.rectDistance / 2)) { console.log(weswiper.rectDistance / 2) throw new Error('') } },
No branches or pull requests
如何才能横向滚动时锁定页面纵向滚动事件呢?现在翻着翻着页面就跑了……
The text was updated successfully, but these errors were encountered: