scroll node in contain to make node visible
import scrollIntoView from 'dom-scroll-into-view';
scrollIntoView(source,container,config);
npm install
npm start
http://localhost:8000/examples/
online example: http://yiminghe.github.io/dom-scroll-into-view/
| name | type | default | description |
|---|---|---|---|
| source | HTMLElement | node wanted to show | |
| container | HTMLElement | ||
| config.alignWithLeft | Boolean | whether align with left edge | |
| config.alignWithTop | Boolean | whether align with top edge | |
| config.offsetTop | Number | ||
| config.offsetLeft | Number | ||
| config.offsetBottom | Number | ||
| config.offsetRight | Number | ||
| config.allowHorizontalScroll | Boolean | whether allow horizontal scroll container | |
| config.onlyScrollIfNeeded | Boolean | whether scroll container when source is visible |
dom-scroll-into-view is released under the MIT license.