https://github.com/afeiship/next-scroll-to
Scroll to api.
https://github.com/afeiship/next-scroll-to
next scroll smooth
Last synced: about 1 month ago
JSON representation
Scroll to api.
- Host: GitHub
- URL: https://github.com/afeiship/next-scroll-to
- Owner: afeiship
- License: mit
- Created: 2020-01-13T06:57:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-01-06T01:31:30.000Z (over 5 years ago)
- Last Synced: 2025-09-07T14:54:40.016Z (9 months ago)
- Topics: next, scroll, smooth
- Language: JavaScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# next-scroll-to
> Scroll to api.
[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]
## installation
```bash
npm install -S @jswork/next-scroll-to
```
## usage
```js
import '@jswork/next-scroll-to';
// top/bottom/number
nx.scrollTo({ el: document.querySelector('.abc'), to: 'top' });
nx.scrollTo({ el: document.querySelector('.abc'), to: 'bottom' });
nx.scrollTo({ el: document.querySelector('.abc'), to: 1000 });
```
## set `scroll-behavior: smooth;`
> Use css3 smooth-scroller.
## license
Code released under [the MIT license](https://github.com/afeiship/next-scroll-to/blob/master/LICENSE.txt).
[version-image]: https://img.shields.io/npm/v/@jswork/next-scroll-to
[version-url]: https://npmjs.org/package/@jswork/next-scroll-to
[license-image]: https://img.shields.io/npm/l/@jswork/next-scroll-to
[license-url]: https://github.com/afeiship/next-scroll-to/blob/master/LICENSE.txt
[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-scroll-to
[size-url]: https://github.com/afeiship/next-scroll-to/blob/master/dist/next-scroll-to.min.js
[download-image]: https://img.shields.io/npm/dm/@jswork/next-scroll-to
[download-url]: https://www.npmjs.com/package/@jswork/next-scroll-to