Skip to content
New issue

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

支持 overscroll-behavior #14

Open
yuanyan opened this issue Feb 24, 2021 · 0 comments
Open

支持 overscroll-behavior #14

yuanyan opened this issue Feb 24, 2021 · 0 comments
Assignees

Comments

@yuanyan
Copy link
Contributor

yuanyan commented Feb 24, 2021

以控制拖动的 bunnce 等默认效果。 https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior

bounce 会增强一些场景下的体验,但也会导致一些场景下带来问题,以及在某些低端机场景下期望关闭该动画来优化性能。参考:https://www.smashingmagazine.com/2018/08/scroll-bouncing-websites/ 由于 safari 不支持该 CSS 属性以及早起某些浏览器不支持,社区有前端层面实现的库来模拟 bounce 效果或者去除 bounce 效果的。比如 https://github.com/lazd/iNoBounce 。实现的方法是判断 touchmove,如果到 scroll 的 top 并且继续向上则 preventDefault(到底部同)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants