# dom-scroll-into-view

> scroll dom node into view automatically

Latest version **2.0.1** (published 2019-08-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install dom-scroll-into-view
pnpm add dom-scroll-into-view
yarn add dom-scroll-into-view
bun add dom-scroll-into-view
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2019-08-12 |
| First published | 2015-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 131.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 156 |
| Maintainers | yiminghe |
| Keywords | dom, scrollIntoView |

## Links

- npm: https://www.npmjs.com/package/dom-scroll-into-view
- Repository: https://github.com/yiminghe/dom-scroll-into-view
- Homepage: http://github.com/yiminghe/dom-scroll-into-view
- Issues: http://github.com/yiminghe/dom-scroll-into-view/issues
- npm.io page: https://npm.io/package/dom-scroll-into-view

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2019-08-12
- 2.0.0 — 2019-07-28
- 1.2.1 — 2016-11-07
- 1.2.0 — 2016-03-22
- 1.1.0 — 2016-02-17
- 1.0.1 — 2015-01-29
- 1.0.0 — 2015-01-29

## README

# dom-scroll-into-view
---

scroll node in contain to make node visible

[![NPM version][npm-image]][npm-url]
[![npm download][download-image]][download-url]

[npm-image]: http://img.shields.io/npm/v/dom-scroll-into-view.svg?style=flat-square
[npm-url]: http://npmjs.org/package/dom-scroll-into-view
[travis-image]: https://img.shields.io/travis/react-component/dom-scroll-into-view.svg?style=flat-square
[travis-url]: https://travis-ci.org/react-component/dom-scroll-into-view
[coveralls-image]: https://img.shields.io/coveralls/react-component/dom-scroll-into-view.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/react-component/dom-scroll-into-view?branch=master
[gemnasium-image]: http://img.shields.io/gemnasium/react-component/dom-scroll-into-view.svg?style=flat-square
[gemnasium-url]: https://gemnasium.com/react-component/dom-scroll-into-view
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square
[node-url]: http://nodejs.org/download/
[download-image]: https://img.shields.io/npm/dm/dom-scroll-into-view.svg?style=flat-square
[download-url]: https://npmjs.org/package/dom-scroll-into-view


## install

[![dom-scroll-into-view](https://nodei.co/npm/dom-scroll-into-view.png)](https://npmjs.org/package/dom-scroll-into-view)

## Usage

```js
import scrollIntoView from 'dom-scroll-into-view';
scrollIntoView(source,container,config);
```
## Development

```
npm install
npm start
```

## Example

http://localhost:8000/examples/

online example: http://yiminghe.github.io/dom-scroll-into-view/

## function parameter

<table class="table table-bordered table-striped">
    <thead>
    <tr>
        <th style="width: 100px;">name</th>
        <th style="width: 50px;">type</th>
        <th style="width: 50px;">default</th>
        <th>description</th>
    </tr>
    </thead>
    <tbody>
        <tr>
          <td>source</td>
          <td>HTMLElement</td>
          <td></td>
          <td>node wanted to show</td>
        </tr>
        <tr>
          <td>container</td>
          <td>HTMLElement</td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>config.alignWithLeft</td>
          <td>Boolean</td>
          <td></td>
          <td>whether align with left edge</td>
        </tr>
        <tr>
          <td>config.alignWithTop</td>
          <td>Boolean</td>
          <td></td>
          <td>whether align with top edge</td>
        </tr>
        <tr>
          <td>config.offsetTop</td>
          <td>Number</td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>config.offsetLeft</td>
          <td>Number</td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>config.offsetBottom</td>
          <td>Number</td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>config.offsetRight</td>
          <td>Number</td>
          <td></td>
          <td></td>
        </tr>
        <tr>
          <td>config.allowHorizontalScroll</td>
          <td>Boolean</td>
          <td></td>
          <td>whether allow horizontal scroll container</td>
        </tr>
        <tr>
          <td>config.onlyScrollIfNeeded</td>
          <td>Boolean</td>
          <td></td>
          <td>whether scroll container when source is visible</td>
        </tr>
    </tbody>
</table>

## License

dom-scroll-into-view is released under the MIT license.

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