# scroll-doc

> Feature detected access to the scroller element

Latest version **0.2.1** (published 2017-11-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install scroll-doc
pnpm add scroll-doc
yarn add scroll-doc
bun add scroll-doc
```

## 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.2.1 |
| Published | 2017-11-23 |
| First published | 2016-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Jonathan Felchlin |
| Maintainers | greengremlin |
| Keywords | scroll, documentElement, scrollTop |

## Links

- npm: https://www.npmjs.com/package/scroll-doc
- Repository: https://github.com/GreenGremlin/scroll-doc
- Homepage: https://github.com/greengremlin/scroll-doc
- Issues: https://github.com/greengremlin/scroll-doc/issues
- npm.io page: https://npm.io/package/scroll-doc

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 0.2.1 (latest) — 2017-11-23
- 0.2.0 — 2017-10-04
- 0.1.3 — 2016-02-10
- 0.1.2 — 2016-02-09
- 0.1.1 — 2016-02-09

## README

# scrollDoc
Feature detected access to the scroller element

``` javascript
import scrollDoc from 'scroll-doc';

const scrollElement = scrollDoc();

// scroll to the top
scrollElement.scrollTop = 0;
```

### How it works
ScrollDoc uses feature detection to detect which element is valid for scrolling the document. It attempts to scroll 1px using document.documentElement if it succeeds, it will reset document.documentElement to it's original scroll position and return document.documentElement; if it fails, it will return document.body. The result is cached and the cached value is returned on subsequent calls.

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