Created
December 8, 2016 15:17
-
-
Save skorotkiewicz/12d6e88e4c28ec09f0bcf2d50451a872 to your computer and use it in GitHub Desktop.
Copy “Make item scroll slower than window (Parallax)
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
$(window).scroll(function () { | |
$('#object').css({ | |
'bottom' : -($(this).scrollTop()/10)+"px" // increase # to make even slower | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment