Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dimayakovlev/6a640d359e1f2d406b1d843afc496753 to your computer and use it in GitHub Desktop.
Save dimayakovlev/6a640d359e1f2d406b1d843afc496753 to your computer and use it in GitHub Desktop.
Smooth Parallax Scroll
$(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