Closed markusdittrich closed 5 years ago
Did you try using background-images with background-attachment: fixed;
instead? It kinda looks like you're trying to achieve that exact same functionality.
Yes that's exactly the functionality I'm trying to recreate. But unfortunately the mobile support for background-attachment: fixed;
looks pretty dire: https://www.quirksmode.org/css/backgrounds-borders/mobile.html#t00
That's why I was hoping to use basicScroll.
I don't think I've ever needed to use it, but your link states Last major update on 5 July 2016
and support (besides iOS), doesn't look that bad here: https://caniuse.com/#feat=background-attachment
Maybe you could check if the browser doesn't support it, and only then use basicScroll with transition: transform 0.1s;
.
Animating something 100% against the scroll direction always looks choppy, because the JS executes after the scrolling, creating a small moment where scroll position and parallax adjustments aren't in sync.
I'm sadly not aware of a solution that could make your animation smoother :-/
Please consider the following fiddle: https://jsfiddle.net/e356rosq/
The images are supposed to appear fixed (by translating them opposed to the scroll direction). But unfortunately this looks a bit "choppy". Is there a way around this?