Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@globocom/scrollspy
Advanced tools
Bind functions to DOM elements based on their scroll position
Scrollspy can be used to bind a callback function to be called when the element reaches its scroll position.
Install via npm
npm install @globocom/scrollspy
Or include one of the browser bundles via a script tag:
<script src="https://unpkg.com/@globocom/scrollspy@0.1.0/dist/scrollspy.min.js"></script>
ScrollSpy.add({
el: DOMElement, // required
callback: Function, // required - A function to be called when the element gets scrolled into the screen
offset: 200, // An offset (in px) to be considered upon scroll calculation
reference: "top" // ["top"|"bottom"] Which side to use as base for position calculation
});
import * as ScrollSpy from "@globocom/scrollspy";
ScrollSpy.add({
el: document.querySelector(".myDiv"),
callback: function() {
// do something
}
});
ScrollSpy.add({
el: document.querySelector(".myDiv2"),
offset: 0,
callback: function() {
// do something
}
});
ScrollSpy.add({
el: document.querySelector(".myDiv3"),
offset: 40,
reference: "bottom",
callback: function() {
// do something
}
});
There is also available a debug function that highlights "scrollspied"
elements:
ScrollSpy.debug();
This project utilizes npm run scripts. See package.json for available scripts.
Scrollspy is licensed under the MIT license.
FAQs
Bind functions to DOM elements based on their scroll position
The npm package @globocom/scrollspy receives a total of 1 weekly downloads. As such, @globocom/scrollspy popularity was classified as not popular.
We found that @globocom/scrollspy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 open source maintainers 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.