Last active
May 7, 2017 10:38
-
-
Save AntonLitvin/4dc934cd508d0e3f2bbdf87256f901c2 to your computer and use it in GitHub Desktop.
Smooth Parallax Scroll
This file contains 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() { | |
var st = $(this).scrollTop() /10; | |
$('.object').css({ | |
'transform' : 'translate3d(0px, ' + st + '%, .01px)', | |
'-webkit-transform' : 'translate3d(0px, ' + st + '%, .01px)' | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment