-
-
Save cknoxrun/699f8f7dd060a28fd504e69f73b5adfe to your computer and use it in GitHub Desktop.
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
# Don't hide the navbar if it's collapsed i.e. we're on a phone | |
if $('.omx-site-navbar') | |
if $('.navbar-toggle').is(":visible") | |
$('.navbar').removeClass('transparent') | |
$('.navbar').addClass('visible') | |
$('.navbar-brand').show() | |
# Only toggle the navbar on the home page when it's not collapsed | |
$(window).scroll -> | |
if !$('.navbar-toggle').is(":visible") | |
# Set distance user needs to scroll before we the navbar switches | |
if $(this).scrollTop() > 50 | |
if !$('.navbar').hasClass('visible') | |
$('.navbar').removeClass('transparent') | |
$('.navbar').addClass('visible') | |
$('.navbar-brand').fadeIn(750) | |
else | |
if !$('.navbar').hasClass('transparent') | |
$('.navbar').addClass('transparent') | |
$('.navbar').removeClass('visible') | |
$('.navbar-brand').fadeOut(750) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment