Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/parallax/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ export const ParallaxLayer = React.memo(
const layer = useMemoOne<IParallaxLayer>(
() => ({
setPosition(height, scrollTop, immediate = false) {
const distance = height * offset
const targetScroll = Math.floor(offset) * height
const distance = height * offset + targetScroll * speed
ctrl.start({
translate: -(scrollTop * speed) + distance,
config: parent.config,
Expand Down