Skip to content

Latest commit

 

History

History
61 lines (43 loc) · 1.19 KB

README.md

File metadata and controls

61 lines (43 loc) · 1.19 KB

ScrollSpy

npm version bower version DevDependencies License

Scrollspy library.

Demo

http://codepen.io/makotot/pen/YyRXOQ

Installation

npm

$ npm install --save scrollspy-js

bower

$ bower install scrollspy

Usage

<div id="js-scrollspy">
  <ul class="js-scrollspy-nav">
    <li><a href="#internal-link">internal-link</a></li>
    <li><a href="#...">...</a></li>
    <li><a href="#...">...</a></li>
    <li><a href="#...">...</a></li>
  </ul>
  ...
  <div>
    <div id="internal-content"></div>
    ...
  </div>
</div>
...
<script src="./bower_components/scrollspy.js"></script>
var spy = new ScrollSpy('#js-scrollspy', {
  nav: '.js-scrollspy-nav > li > a',
  className: 'is-inview'
});

License

MIT