Created
March 24, 2014 19:55
-
-
Save jlittlejohn/9747755 to your computer and use it in GitHub Desktop.
JS: Scroll Effects
This file contains hidden or 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
// Scroll Effects | |
$(window).scroll(function(){ | |
var scrollVar = $(window).scrollTop(); | |
var element = $('section#main'); | |
$(homeContent).css({'bottom': scrollVar }); // scrolls element off page | |
$(homeContent).css({'opacity': (100 - scrollVar) / 100 }); // fades element out on scroll | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment