Created
November 29, 2016 23:47
-
-
Save bumble-bee-chuna/8d03e613d7853333fb307df864982f4b 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
/* If on a desktop, change nav's logo and hamburger when past the hero */ | |
if( screen.width >= 875 ) { | |
var scroll_pos = 0; | |
$(document).scroll(function() { | |
scroll_pos = $(this).scrollTop(); | |
if(scroll_pos > 520) { | |
$("#logo").attr("src", "assets/images/logo-scroll.svg"); | |
$("#hamburger").attr("src", "assets/images/hamburger-scroll.svg") | |
} else { | |
$("#logo").attr("src", "assets/images/logo.svg"); | |
$("#hamburger").attr("src", "assets/images/hamburger.svg"); | |
} | |
}); | |
} | |
/* Popout sidebar navigation */ | |
function openNav() { | |
document.getElementById("sidebar-nav").style.width = "90%"; | |
} | |
function closeNav() { | |
document.getElementById("sidebar-nav").style.width = "0"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment