Created
August 10, 2013 02:19
-
-
Save jtremback/6198753 to your computer and use it in GitHub Desktop.
Parralax code from royce haynes
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
// Functional parallaxing calculations | |
function slidingTitle() { | |
//Get scroll position of window | |
windowScroll = $(this).scrollTop(); | |
//Slow scroll of .art-header-inner scroll and fade it out | |
$artHeaderInner.css({ | |
'margin-top' : -(windowScroll/3)+"px", | |
'opacity' : 1-(windowScroll/550) | |
}); | |
//Slowly parallax the background of .art-header | |
$artHeader.css({ | |
'background-position' : 'center ' + (-windowScroll/8)+"px" | |
}); | |
//Fade the .nav out | |
$nav.css({ | |
'opacity' : 1-(windowScroll/400) | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment