Skip to content

Feature request: support for elements that become fixed in scroll-rig (track initial position, then keep fixed) #60

@mohAmineBrs

Description

@mohAmineBrs

Hi @ffdead

I’m using scroll-rig to mirror DOM elements into WebGL, and it works great for elements that stay in normal document flow.

However, I’m running into a limitation when an element should behave like fixed UI after its initial layout position.

Currently scroll-rig positions and scales the fixed element correctly initially then as we scroll the WebGL instance of the element keep moving in WebGL space.

Desired behavior:

Track initial DOM position normally to perfectly align with the layout, then stop applying scroll offset, so the WebGL instance stays fixed relative to the viewport while scrolling

Conceptually, this is “track once, then freeze in screen space”.

Something like: isFixed or scrollMode: 'scroll' | 'fixed'??

When enabled: Initial bounding rect is captured normally, scroll offset is ignored after that, position updates only on resize, not on scroll.

I’m aware of StickyScrollScene, but it only addresses cases where the tracked element itself becomes sticky.
In my situation, the sticky/fixed behavior belongs to the section container, while the elements being mirrored (text/images) are nested inside it.

Happy to help with discussion or testing if this is something you’d consider 👍

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions