shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
scrollSpy
Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.scroll
This function allows you to add/remove automatically the -active class on
some passed links that have a href attribute that points to an element on the page.
Params
- settings{}TScrollSpySettings
The settings you want to override
Example
import { scrollSpy } from '@blackbyte/sugar/scroll';
scrollSpy($myLinks);Settings
- offsetwindow.innerHeight/2number
The offset you want before adding the classes
- activeClass-activestring
The class name you want to add/remove
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space