scroll-syncer

1.2.1 • Public • Published

Scroll Syncer

Synchronize scoll position from one element to several elements

Usage

import ScrollSyncer from 'scroll-syncer'
 
var ss = new ScrollSyncer(
  true, /* vertical scroll position */
  true, /* horizontal scroll position */
  true  /* use passive event binding */
)
 
// Synchronize from el1
ss.from(el1)
// Synchronize to el2
ss.to(el2)
 
// Stop synchronize from el1, but el2 will be kept as synchronize target.
ss.off(el1)
// Stop synchronize to el2, but el1 will be kept as synchronize origin.
ss.off(el2)
// Tear down the synchronizer.
ss.off()

Readme

Keywords

Package Sidebar

Install

npm i scroll-syncer

Weekly Downloads

16

Version

1.2.1

License

MIT

Last publish

Collaborators

  • cool_zjy