Created
October 7, 2012 10:48
-
-
Save kaneshin/3847842 to your computer and use it in GitHub Desktop.
change opacity when scrolling
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
$(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