A simple navigation bar that efficiently attaches / detaches to the top of the viewport upon scrolling
...
Download the production version or the development version.
import { stickyElement, stickyNav } from '../src/stickynav.es6.js';
var stickyElement = require('../src/stickynav.es6.js').stickyElement;
var stickyNav = require('../src/stickynav.es6.js').stickyNav;
require(['stickyElement', 'stickyNav'], function(stickyElement, stickyNav){
// ...
})
<script src="path/to/stickyNav.js"></script>
<script>
new stickyNav({
nav: '#sticky'
});
</script>
...
- IE8+
- Safari / Chrome
- Firefox
- iOS
- Android
Please see the test / demo directory
- initial commit