Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You need rAF #2

Open
danyj opened this issue Sep 14, 2015 · 2 comments
Open

You need rAF #2

danyj opened this issue Sep 14, 2015 · 2 comments

Comments

@danyj
Copy link

danyj commented Sep 14, 2015

You need

requestAnimationFrame

there , script is killing your page
e3bw4fv

see this https://gist.github.com/paulirish/1579671

add raf and do this instead

$(window).bind('scroll',function(e){
  requestAnimationFrame ( parallaxImgScroll );
});

and in css

.parallax-img-container img{
    -webkit-transform: translateZ(0);
    -webkit-transform: translate3d(0, 0, 0);
    -webkit-transform-style: preserve-3d;
    -webkit-perspective: 1000;
    -webkit-backface-visibility:hidden; 
}

than you will be able to get 60 FPS

screenshot_4

@danyj
Copy link
Author

danyj commented Sep 14, 2015

And if you do translate3d instead positions move, your script will be much faster and animations smoother

@cyntss
Copy link
Owner

cyntss commented Jan 30, 2016

very good tip !!! will do this as soon as i have time to check this script again :D really appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants