Skip to content

Instantly share code, notes, and snippets.

@mapsam
Last active December 20, 2015 05:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mapsam/6076796 to your computer and use it in GitHub Desktop.
Save mapsam/6076796 to your computer and use it in GitHub Desktop.
css box-shadow fading
function init() {
$(window).scroll(function() {
top = $(window).scrollTop();
if ( top < 15 ) {
$("nav").fadeOut("fast", function() {
$(this).css('box-shadow', 'none');
});
}
else {
$("nav").fadeIn("fast", function() {
$(this).css('box-shadow', '0 0 10px 2px #111');
});
}
})
}
window.onLoad = init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment