scrollspy-js
v0.1.3
Published
Scrollspy library
Downloads
484
Readme
ScrollSpy
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