Create a gist now

Instantly share code, notes, and snippets.

js
if(location.hash){
var e = document.getElementById(location.hash.substr(1));
e.scrollIntoView();
}
//Fix on scroll
var wrap = $("#wrapper-navbar .navbar");
$(document).scroll(function(e) {
if ($(this).scrollTop() > 247)
wrap.addClass("fixed");
else
wrap.removeClass("fixed");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment