Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.addEventListener("scroll", function() {
- if (window.scrollY > 200) {
- $('#navbar').css({top:"100px"});
- }
- else {
- $('#navbar').css({top:"0px"});
- }
- },false);
- #navbar{
- top:0;
- position:fixed;
- transition: top 0.5s;
- }
- $('#navbar').animate({top:"100px"});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement