Last active
August 29, 2015 13:56
-
-
Save gugote/9229785 to your computer and use it in GitHub Desktop.
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
$(document).ready(function() { | |
// get basic measures | |
$wwidth = $(window).width(); | |
$wheight = $(window).height(); | |
// based on scroll, toggle header | |
$(window).scroll(function() { | |
var y = $(window).scrollTop(); | |
if (y > $wheight+($wheight/2)) { | |
$('header').fadeIn('slow'); | |
} else if (y <= $wheight+($wheight/2)) { | |
$('header').fadeOut('slow'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Useful when you have a full height first section.