Skip to content

Instantly share code, notes, and snippets.

@ckahle33
Last active September 22, 2016 07:43
Show Gist options
  • Save ckahle33/6e8dfb9765f06b99b77ad2dad92e585d to your computer and use it in GitHub Desktop.
Save ckahle33/6e8dfb9765f06b99b77ad2dad92e585d to your computer and use it in GitHub Desktop.
$(document).on('scroll', function(e){
console.log($(this).scrollTop());
if ($(this).scrollTop() > $(".reddit-infobar").offset().top) {
//toggle a class instead here
$(".reddit-infobar").css('position', 'fixed')
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment