Skip to content

Instantly share code, notes, and snippets.

@dustintheweb
Created March 19, 2015 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustintheweb/87a6901d5c9bb73dd5ac to your computer and use it in GitHub Desktop.
Save dustintheweb/87a6901d5c9bb73dd5ac to your computer and use it in GitHub Desktop.
Headroom Smart Offset
// -- headroom ---------------
(function($) {
var headOffset = (app.obj.$section.filter('.feature').height() / 2) - (app.obj.$header.height());
app.obj.$header.headroom({
'offset': headOffset,
'tolerance': 5,
'classes': {
'initial': 'animated',
'pinned': 'slideDown',
'unpinned': 'slideUp'
}
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment