Skip to content

Instantly share code, notes, and snippets.

@agragregra
Created May 5, 2015 21:35
Show Gist options
  • Save agragregra/52e992406069e50c8641 to your computer and use it in GitHub Desktop.
Save agragregra/52e992406069e50c8641 to your computer and use it in GitHub Desktop.
jQuery Header Content FadeOut on Scroll
$(window).scroll(function() {
var st = $(this).scrollTop();
if($(window).height()+500 > $("header").height()) {
$("header .col-md-12").css({
"transform" : "translate3d(0px, " + st /18 + "%, 0px)",
"-webkit-transform" : "translate3d(0px, " + st /18 + "%, 0px)",
"opacity" : "1" - st/700
});
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment