Last active
March 7, 2016 08:22
-
-
Save Serega1288/0beaf013fde3092f7dc2 to your computer and use it in GitHub Desktop.
scrollTop to window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(window).scroll(function() { | |
if ($(this).scrollTop() > 1){ | |
$('header').addClass("sticky"); | |
} | |
else{ | |
$('header').removeClass("sticky"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment