Show HN: Simple JavaScript Parallax effect
dkuntz2.com
dkuntz2.com
The image would still just scroll like normal if translate wasn't supported. Plus the processing would be moved to the gpu and if the browser doesn't understand translate then it probably shouldn't be showing parallax pages. Nothing is worse then a jumpy site.
My main goal was to have a functioning parallax effect that was reasonably simple.
Here's the mdn page: https://developer.mozilla.org/en-US/docs/Web/CSS/transform
There's also a 3d version and if you set the z value to 0, the whole site looks the same and runs ridiculously better.
here's the performance stats: http://jsperf.com/translate3d-vs-xy/28
Making it animate, that's not really easy to do using basic JS. Supposedly I could have a function call that moves it to the correct position more slowly using intervals, but that seems kinda hacky to me.
Basically, it works, but it's not amazing (which you pointed out).