We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df943c0 commit 72081e3Copy full SHA for 72081e3
packages/parallax/src/index.tsx
@@ -68,7 +68,8 @@ export const ParallaxLayer = React.memo(
68
const layer = useMemoOne<IParallaxLayer>(
69
() => ({
70
setPosition(height, scrollTop, immediate = false) {
71
- const distance = height * offset
+ const targetScroll = Math.floor(offset) * height
72
+ const distance = height * offset + targetScroll * speed
73
ctrl.start({
74
translate: -(scrollTop * speed) + distance,
75
config: parent.config,
0 commit comments