sticky-header

pure javascript implementation that makes an element stick to the top when scrolling down the page

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
sticky-header
1610.3.08 years ago10 years agoMinified + gzip package size for sticky-header in KB

Readme

Usage:

// commonjs
var sticky = require('sticky-header');
	
// or directly include the script then 'sticky' will be global
	
var nav = document.getElementById('nav')
// make '.nav' stick to the top
sticky(nav);

// make '.nav' stick to top 100px
sticky(nav, 100);

Example:

See http://ltebean.github.io/sticky-header