Skip to content

Instantly share code, notes, and snippets.

@kaneshin
Created October 7, 2012 10:48
Show Gist options
  • Save kaneshin/3847842 to your computer and use it in GitHub Desktop.
Save kaneshin/3847842 to your computer and use it in GitHub Desktop.
change opacity when scrolling
$(document).ready(function() {
$(window).scroll(function() {
if ($(this).scrollTop() > 0) {
$('header').css('opacity', 0.8);
} else {
$('header').css('opacity', 1);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment