Created
December 7, 2016 08:50
-
-
Save iworkforthem/392a0fef06a8a0b2e899315b5155e965 to your computer and use it in GitHub Desktop.
show navbar when scroll down.
This file contains 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
.navbar { | |
position:fixed; | |
top:0px; | |
width:100%; | |
height:75px; | |
background-color:#fff; | |
color: #FFFFFF; | |
z-index:9999; | |
display: none; | |
border: none; | |
} | |
<script type="text/javascript"> | |
(function($) { | |
$(document).ready(function(){ | |
$(window).scroll(function(){ | |
if ($(this).scrollTop() > 200) { | |
$('.navbar').fadeIn(500); | |
} else { | |
$('.navbar').fadeOut(500); | |
} | |
}); | |
}); | |
})(jQuery); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment