https://github.com/aweiu/scroll-switch
简单来说,它就是用来滚动切换列表项的。
https://github.com/aweiu/scroll-switch
Last synced: 9 months ago
JSON representation
简单来说,它就是用来滚动切换列表项的。
- Host: GitHub
- URL: https://github.com/aweiu/scroll-switch
- Owner: aweiu
- License: apache-2.0
- Created: 2020-09-12T09:38:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-14T06:25:55.000Z (about 5 years ago)
- Last Synced: 2025-03-01T07:37:49.652Z (10 months ago)
- Language: TypeScript
- Homepage:
- Size: 9.77 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scroll-switch
简单来说,它就是用来滚动切换列表项的。
## 适用场景
当某些列表页希望用户每次只聚焦于单个列表项,但又不是每个列表项都是占满屏幕时就不太适合使用全屏滚动方案了。
所以,可以在保留原有滚动查看的基础上再增加一个上下切换的功能,仅作为滚动查看的辅助工具而存在看起来就可以很好的满足该种需求。
## 特性
- next、pre 会根据当前列表滚动位置智能切换到最符合用户预期的条目
- 相对于 [scrollIntoView](https://developer.mozilla.org/zh-CN/docs/Web/API/Element/scrollIntoView) 支持设置 offset,可以更好的控制滚动目标位置
## 演示
[scroll-switch.mp4](https://aweiu.com/documents/scroll-switch/scroll-switch.mp4)
## 文档
https://aweiu.com/documents/scroll-switch/