# scroll-to-target

> A simpe, light and reliable scroll library

Latest version **0.0.8** (published 2017-12-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install scroll-to-target
pnpm add scroll-to-target
yarn add scroll-to-target
bun add scroll-to-target
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2017-12-05 |
| First published | 2017-09-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | iam@murilobastos.com |
| Maintainers | murilobast |
| Keywords | animate, scroll, smooth, light |

## Links

- npm: https://www.npmjs.com/package/scroll-to-target
- Repository: https://github.com/murilobast/scroll-to-target
- Homepage: https://github.com/murilobast/scroll-to-target#readme
- Issues: https://github.com/murilobast/scroll-to-target/issues
- npm.io page: https://npm.io/package/scroll-to-target

## Alternatives

- [@oh-my-pi/pi-natives](https://npm.io/package/@oh-my-pi/pi-natives.md) — 51.8K weekly downloads
- [@capgo/capacitor-light-sensor](https://npm.io/package/@capgo/capacitor-light-sensor.md) — 3.0K weekly downloads
- [@heyhuynhgiabuu/pi-diff](https://npm.io/package/@heyhuynhgiabuu/pi-diff.md) — 492 weekly downloads
- [@lotsa/verdant-lang-asm](https://npm.io/package/@lotsa/verdant-lang-asm.md) — 38 weekly downloads
- [new-era-syntax](https://npm.io/package/new-era-syntax.md) — 20 weekly downloads

## Recent versions

- 0.0.8 (latest) — 2017-12-05
- 0.0.6 — 2017-12-04
- 0.0.5 — 2017-09-13
- 0.0.4 — 2017-09-06
- 0.0.3 — 2017-09-06
- 0.0.2 — 2017-09-06
- 0.0.1 — 2017-09-06

## README

# scroll-to-target (scrollToTarget)

Simple, small, reliable and pure javascript scroll library with 0 dependencies.

[![NPM](https://nodei.co/npm/scroll-to-target.png)](https://nodei.co/npm/scroll-to-target/)

## `Usage`
```js
scrollToTarget(selector, speed, offset)
```
###### name : *string*
> A valid dom selector 
> 
> *Required*

###### speed : *number*
> Scroll duration in milliseconds 
> 
> *Optional, defaults to: 300 {ms}*

###### offset : *number*
> Space in pixels between the target element and the window top.
> 
> *Optional, defaults to: 0 {pixels}*


## `Example`

```js
scrollToTarget('#valid-dom-element-selector', 500, 80)
```
The code above will scroll the page to the #valid-dom-element-selector with 80px gutter and a duration of 500ms.

## `Compatibility`

IE8+, iOS Safari 3.2+, MS Edge, Chrome 4+, Firefox 3.5+
## `LICENSE`

MIT

---
_Source: https://npm.io/package/scroll-to-target · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
