Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eclass/scrollmove
https://github.com/eclass/scrollmove
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/eclass/scrollmove
- Owner: eclass
- License: mit
- Created: 2019-11-12T20:23:27.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-11-19T11:55:32.000Z (about 1 month ago)
- Last Synced: 2024-11-19T12:54:06.887Z (about 1 month ago)
- Language: TypeScript
- Size: 327 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 41
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @eclass/scrollmove
[![npm](https://img.shields.io/npm/v/@eclass/scrollmove.svg)](https://www.npmjs.com/package/@eclass/scrollmove)
[![Build Status](https://travis-ci.org/eclass/scrollmove.svg?branch=master)](https://travis-ci.org/eclass/scrollmove)
[![downloads](https://img.shields.io/npm/dt/@eclass/scrollmove.svg)](https://www.npmjs.com/package/@eclass/scrollmove)
[![dependencies](https://img.shields.io/david/eclass/scrollmove.svg)](https://david-dm.org/eclass/scrollmove)
[![devDependency Status](https://img.shields.io/david/dev/eclass/scrollmove.svg)](https://david-dm.org/eclass/scrollmove#info=devDependencies)> Modulo para mover el scroll suave hasta centrar un elemento en pantalla
### 🏠 [Homepage](https://github.com/eclass/scrollmove#readme)
## Prerequisites
- node >=10.16.3
## Install
```sh
npm i @eclass/scrollmove
```## Run tests
```sh
npm run test
```## Example 📖
`goTo()` receives two parameters `id` and `options`
```js
import goTo from '@eclass/scrollmove'
...
goTo(`#question-98765`)}>
/>
``````js
import goTo from '@eclass/scrollmove'
...
goTo(`#question-98765`, { behavior: 'smooth', block: 'center' })}>
/>
```### Params
- id: string, that identifies the element in the dom.
- options: object, with the properties `behavior`, `block` and `inline`. Default is set `{ behavior: 'smooth', block: 'center' }`.More options from api of [scrollIntoView](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView)
## Author
👤 **Ender Bonnet**
- Twitter: [@enBonnet](https://twitter.com/enbonnet)
- Github: [@enBonnet](https://github.com/enbonnet)## 📝 License
Copyright © 2019 [Ender Bonnet (https://enbonnet.me/)](https://github.com/eclass).
This project is [MIT](https://github.com/eclass/scrollmove/blob/master/LICENSE) licensed.