
Security News
Node.js Homepage Adds Paid Support Link, Prompting Contributor Pushback
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
nav-scroll-spy
Advanced tools
Simple ES6 Scroll Spy Class
Example: komock.github.io/nav-scroll-spy
npm i --save-dev nav-scroll-spy
// Absolute path to module 'node_modules/nav-scroll-spy/src/js/nav-scroll-spy.js'
import NavScrollSpy from 'nav-scroll-spy';
let spy = new NavScrollSpy();
spy.init();
<nav>
<ul>
<li><a href="#section-1">section-1</a></li>
<li><a href="#section-2">section-2</a></li>
</ul>
</nav>
Option | Type | Default | Description |
---|---|---|---|
offset | number | 0 | Scroll offset |
currentClass | string | 'active' | Element class for current navigation item (or items). Class will be applied to link parent. |
selector | string (html) | 'nav a[href*="#"]' | Selector for navigation links |
throttle | number | 100 | Throttling window events (scroll and resize) to improve performance |
FAQs
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
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.
Research
Security News
The Socket Research Team investigates a malicious Python typosquat of a popular password library that forces Windows shutdowns when input is incorrect.