# window-scroller

> window scrolling animating

Latest version **1.0.4** (published 2017-03-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install window-scroller
pnpm add window-scroller
yarn add window-scroller
bun add window-scroller
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2017-03-10 |
| First published | 2017-01-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Shy Alter |
| Maintainers | puemos |
| Keywords | scroll, animation, scrollTo, scroller, scrollTop, animated, window, scrollbar, animate, bar |

## Links

- npm: https://www.npmjs.com/package/window-scroller
- Repository: https://github.com/Puemos/window-scroller
- Issues: https://github.com/Puemos/window-scroller/issues
- npm.io page: https://npm.io/package/window-scroller

## Dependencies (3)

- [raf](https://npm.io/package/raf.md) ^3.3.0
- [bluebird](https://npm.io/package/bluebird.md) ^3.4.7
- [bounding-client-rect](https://npm.io/package/bounding-client-rect.md) ^1.0.5

## Alternatives

- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K weekly downloads
- [persona-harness](https://npm.io/package/persona-harness.md) — 4.7K weekly downloads
- [@tsparticles/effect-bubble](https://npm.io/package/@tsparticles/effect-bubble.md) — 4.6K weekly downloads
- [f3d](https://npm.io/package/f3d.md) — 730 weekly downloads
- [spark-html-motion](https://npm.io/package/spark-html-motion.md) — 298 weekly downloads

## Recent versions

- 1.0.4 (latest) — 2017-03-10
- 1.0.2 — 2017-01-30
- 1.0.1 — 2017-01-30
- 1.0.0 — 2017-01-30

## README

# window-scroller

## Credit:

@shunryu111 <http://stackoverflow.com/users/2630316/shunryu111>

## Based on:

<http://stackoverflow.com/a/26798337/5068410>

## install

```bash
npm install window-scroller --save
```

## usage

```javascript
import Scroller from 'window-scroller';
// OR
const Scroller = require('window-scroller');

// Position
Scroller.to(500).scroll()
Scroller.to(500).speed(700).scroll()
Scroller.to(500).easing('easeOutSine').scroll();
Scroller.to(500).speed(700).easing('easeInOutSine').scroll();

// Element in the DOM
const element = document.getElementById('rolling');
Scroller.to(element).scroll()
Scroller.to(element).speed(700).scroll()
Scroller.to(element).easing('easeInOutQuint').scroll();
Scroller.to(element).speed(700).easing('easeInOutQuint').scroll();

// Save the scroller and use whenever you need
const rollingScroller = Scroller.to(element).speed(700).easing('easeInOutQuint');
rollingScroller.scroll()

const topScroller = Scroller.to(0).speed(700).easing('easeOutSine');
topScroller.scroll()
```

## options

speed (Integer):

- 0 -> inf

easing (String):

- easeOutSine
- easeInOutSine
- easeInOutQuint

to (Integer | Element):

- DOM Element
- Integer

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