项目
在 GitHub 查看 
appleple/scroll-hint
关于
一个 JavaScript 库,通过指针图标提示用户元素可横向滚动。
开发工具实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文ScrollHint
Suggests that the elements are scrollable horizontally, with the pointer icon.

Installation
via npm
npm install scroll-hint --save
via yarn
yarn add scroll-hint
via cdn
<link rel="stylesheet" href="https://unpkg.com/scroll-hint@latest/css/scroll-hint.css">
<script src="https://unpkg.com/scroll-hint@latest/js/scroll-hint.js"></script>
Browser support
モダンブラウザ (Chrome / Edge / Firefox / Safari の最新版) が対象です。Object.assign を使うため IE11 は非対応です。
アイコンの縮小表示には CSS コンテナクエリ (container-type: size) を使います。非対応のブラウザでは縮小せず、はみ出した部分はクリップされます。
Usage
import the js with babel and Browserify/Webpack
import ScrollHint from 'scroll-hint';
new ScrollHint('.js-scrollable');
Option
| Name | Default | Description |
|---|---|---|
suggestClass |
is-active | Classname to be added when the element is scrolled-in |
scrollableClass |
is-scrollable | Classname to be added when the element is scrollable |
scrollableRightClass |
is-right-scrollable | Classname to be added when the element is right-scrollable |
scrollableLeftClass |
is-left-scrollable | Classname to be added when the element is left-scrollable |
scrollHintClass |
scroll-hint | Classname to be added to the element |
scrollHintShadowWrapClass |
scroll-hint-shadow-wrap | Class name added to the wrapper element for shadow effects |
scrollHintIconClass |
scroll-hint-icon | Classname to be added to the icon |
scrollHintIconAppendClass |
scroll-hint-icon-white | Another classname to be added to the element's icon |
scrollHintIconWrapClass |
scroll-hint-icon-wrap | Classname to be added to the icon's wrapper |
scrollHintText |
scroll-hint-text | Classname to be added to the text |
remainingTime |
-1 | When to hide scroll-hint icon (ms) |
scrollHintBorderWidth |
10 | Shadowbox border width of the element |
enableOverflowScrolling |
true | When using iOS and the value is true, -webkit-overflow-scrolling property will be added to the element |
suggestiveShadow |
false | Show suggestive shadow, when the element is scrollable |
applyToParents |
false | Apply JavaScript to the parent element |
offset |
0 | You can change criteria for scrollable. |
i18n.scrollable |
scrollable | You can change the scrollable text from here |
Development
lib/ と js/ はビルド成果物のため Git では管理せず、npm publish 時(prepack)に生成します。
npm ci
npm run dev # ビルドの watch と examples/index.html の配信
npm test # lint + テスト (カバレッジ 90% 未満で失敗)
npm run build # lib/ (CJS/ESM) と js/ (ブラウザ向け) を生成
Release
npm run release:patch # minor / major も同様
v*.*.* タグを push すると GitHub Actions が npm の Trusted Publishing (OIDC) で公開します。
事前に npmjs.com 側で、このリポジトリの publish.yml を Trusted Publisher として登録してください。
探索相关项目
加载中…