skrlspy

Scroll spy

Usage no npm install needed!

<script type="module">
  import skrlspy from 'https://cdn.skypack.dev/skrlspy';
</script>

README

skrlspy

Scroll spy

Install

npm install --save skrlspy
component install andrepolischuk/skrlspy

Usage

Set sections and nav classes via data-skrlspy and data-skrlspy-nav attributes:

<body data-skrlspy=".section" data-skrlspy-nav=".nav">

API

slrlspy(options);

Example:

skrlspy({
  section : '.section',
  nav : '.nav'
});

Options:

  • section - section class or ID
  • nav - navigation class or ID
  • navActiveClass - navigation active children classname
  • change - function called when changing section

Support

  • Internet Explorer 8+
  • Chrome
  • Safari
  • Firefox
  • Opera

License

MIT