# scrolld

> Javascript plugin that will tell how far a thing has been vertically scrolld.

Latest version **1.0.7** (published 2017-08-21) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install scrolld
pnpm add scrolld
yarn add scrolld
bun add scrolld
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2017-08-21 |
| First published | 2017-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Casper Korsgaard |
| Maintainers | hallojoe |

## Links

- npm: https://www.npmjs.com/package/scrolld
- Repository: https://github.com/hallojoe/scrolld
- Homepage: https://github.com/hallojoe/scrolld#readme
- Issues: https://github.com/hallojoe/scrolld/issues
- npm.io page: https://npm.io/package/scrolld

## Recent versions

- 1.0.7 (latest) — 2017-08-21
- 1.0.6 — 2017-08-20
- 1.0.5 — 2017-08-20
- 1.0.4 — 2017-08-20
- 1.0.3 — 2017-08-20
- 1.0.2 — 2017-08-20
- 1.0.1 — 2017-08-19
- 1.0.0 — 2017-08-19

## README

# Scrolld
Javascript plugin that will tell how far a thing has been vertically scrolld.

# Install

    npm install scrolld --save

# Usage
Instantiate a Scrolld object and pass a target in the constructor. If  target is empty, then document set as target. 

    var scrolld = new Scrolld();
    console.log(scrolld.percent())

Passing a target:

    var scrolldOnElement = new Scrolld(document.querySelector('#selector'));
    console.log(scrolldOnElement.percent())

Actually using it for something:

    var scrolld = new Scrolld(), 
        token = -1, 
        scrolling = false;

    window.addEventListener("scroll", function (e) {
        scrolling = true;

        console.log(scrolld.percent());

        if (token !== -1)
            clearTimeout(token);
        token = setTimeout(function () {
            scrolling = false;
        }, 500);
    });

Tested on #document, TEXTAREA and DIV    

# Try Scrolld
<a href="https://hallojoe.github.io/scrolld/demo/">Demo</a> - Todo: make TEXTAREA and DIV demo...

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