Skip to content

Instantly share code, notes, and snippets.

@chadspencer
Created January 26, 2012 16:40
Show Gist options
  • Save chadspencer/1683700 to your computer and use it in GitHub Desktop.
Save chadspencer/1683700 to your computer and use it in GitHub Desktop.
$(window).scroll(function(){
$('body').removeClass('sticky');
if ($(window).scrollTop() >= 180){
$('body').addClass('sticky');
}
/*$('#header ul li a').removeClass('current').each(function(index) {
var section = $(this).attr('href');
if ($(window).scrollTop() >= $(section).offset().top) {
$('#header ul li a').removeClass('current');
$('#header ul li a[href='+section+']').addClass('current');
}
});*/
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment