Dom-scroll-into-view

dom-scroll-into-view

scroll node in contain to make node visible

dom-scroll-into-view a dom util that helps in scrolling to node that is targeted.

Get it: npm install dom-scroll-into-view

Sample usage:

1
2
var scrollIntoView = require('dom-scroll-into-view');
scrollIntoView(source,container,config);
1
2
3
4
5
6
7
8
9
10
11
//config
   {
       alignWithLeft,
       alignWithTop,
       allowHorizontalScroll,
       onlyScrollIfNeeded,
       offsetTop,
       offsetLeft,
       offsetBottom,
       offsetRight
   }

GIF FTW!

dom-scroll-into-view.gif

Suggest a module

Comments