I hereby claim:
- I am piotr-gawlowski on github.
- I am d3vilroot (https://keybase.io/d3vilroot) on keybase.
- I have a public key ASCpTHuxBxfxRC07S2osZxt1k2Aaju8W8h-kM60PTsLEyAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// synchronize scrollTop value between multiple dom elements | |
export const syncScroll = elements => { | |
const syncElements = (collection, value) => { | |
collection.forEach(item => | |
item.el.scrollTop = (item.el.scrollHeight - item.el.clientHeight) * value, | |
); | |
}; | |
const handleNativeScroll = ({currentTarget}) => { | |
const v = currentTarget.scrollTop / (currentTarget.scrollHeight - currentTarget.clientHeight); |