Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

scroll-switch

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scroll-switch

简单来说,它就是用来滚动切换列表项的

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

scroll-switch

简单来说,它就是用来滚动切换列表项的。

适用场景

当某些列表页希望用户每次只聚焦于单个列表项,但又不是每个列表项都是占满屏幕时就不太适合使用全屏滚动方案了。

所以,可以在保留原有滚动查看的基础上再增加一个上下切换的功能,仅作为滚动查看的辅助工具而存在看起来就可以很好的满足该种需求。

特性

  • next、pre 会根据当前列表滚动位置智能切换到最符合用户预期的条目
  • 相对于 scrollIntoView 支持设置 offset,可以更好的控制滚动目标位置

演示

scroll-switch.mp4

文档

https://aweiu.com/documents/scroll-switch/

Keywords

next

FAQs

Package last updated on 14 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts