Skip to content

Instantly share code, notes, and snippets.

@Hatteron
Forked from agragregra/header_fadeout.js
Created July 8, 2017 16:09
Show Gist options
  • Save Hatteron/6eb03ce79d50137d1be953775bed27c0 to your computer and use it in GitHub Desktop.
Save Hatteron/6eb03ce79d50137d1be953775bed27c0 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