Skip to content

Instantly share code, notes, and snippets.

@DarrylD DarrylD/stickyheader.js
Last active Dec 27, 2015

What would you like to do?
Simple fixed header after trigger point
var triggerElement = $(".container") //element to he used to trigger the fixed header
, header = $(".header") //element of header
, stickyClass = "stickit" // class to be used to give the fixed header a fixed position
var offset = 0,sticky = false,top = $(window).scrollTop();
if (triggerElement.offset().top < top) {
sticky = true;
} else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.