
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@171h/scroll-sync
Advanced tools
Scroll synchronization (`scroll-sync`), which associates multiple elements with scroll properties (`overflow: scroll`). When a scroll event occurs in one of the elements, the scroll effect is mapped to all the elements associated with it. To achieve synch
Scroll synchronization (scroll-sync
), which associates multiple elements with scroll properties (overflow: scroll
). When a scroll event occurs in one of the elements, the scroll effect is mapped to all the elements associated with it. To achieve synchronization purposes. scroll-sync
supports fixed synchronization (px
) and relative synchronization (%
).
This is a rewrite of scroll-sync
with typescript
and added some new features liking scroll-sync only by x or y.
npm install @171h/scroll-sync
import ScrollSync from 'scroll-sync'
const ss = new ScrollSync({
disabled: false, // [Boolean] Default value, allow to be empty.
relative: true, // [Boolean] Default value, allow to be empty.
doms: document.querySelectorAll('.scroll-container') // [Array] These elements must set scroll attributes.
})
// do sth....
// You can also find another opportunity to set related elements after instantiating the object.
ss.set(document.querySelectorAll('.scroll-container'))
// Or add or delete.
// ss.add([elements])
// ss.remove([elements])
// You can also actively clear the listener event and clear the cache.
// ss.clear()
// add elements to scroll-sync.
ss.add(document.documentElement)
// or use array.
ss.add(document.querySelectorAll('.other-scroll-container'))
// remove elements to scroll-sync.
ss.remove(document.documentElement)
// or use array.
ss.remove(document.querySelectorAll('.other-scroll-container'))
// reset elements to scroll-sync.
ss.set(document.documentElement)
// or use array.
ss.set(document.querySelectorAll('.other-scroll-container'))
// reset elements to scroll-sync.
ss.clear()
FAQs
Scroll synchronization (`scroll-sync`), which associates multiple elements with scroll properties (`overflow: scroll`). When a scroll event occurs in one of the elements, the scroll effect is mapped to all the elements associated with it. To achieve synch
The npm package @171h/scroll-sync receives a total of 3 weekly downloads. As such, @171h/scroll-sync popularity was classified as not popular.
We found that @171h/scroll-sync demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.