This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Jaime De Ascanio
Posted Jun 01 - Read on Facebook

Hello! This is my first post here, and I hope is not a silly question, I'm trying to get the scroll position of a layer when I start to drag the layer, thanks!


Benjamin Den Boer

Hey Jaime De Ascanio - is the draggable layer also wrapped within a ScrollComponent by any chance? Otherwise you can indeed simply print out the x and y position by referencing "this" within the conditional statement in your DragMove event, like:

Jaime De Ascanio

Benjamin Den Boer the draggable layer is within a ScrollComponent, i tried that, but it gives me a fixed value for every layer, it does not change with the scrool, what i need it to get the top position (from the screen) of the layer when i scroll

Benjamin Den Boer

Hey Jaime De Ascanio - ah, I see. Then you'll probably want to grab the scroll.scrollY value instead:

Jaime De Ascanio

Benjamin Den Boer This is what im working on, I want to place feedback layers that appears on the sides in the middle of the the layer that i'm dragging

Jaime De Ascanio

Benjamin Den Boer thank for your help! I've acomplished what i wanted to do using this.draggable.cursorStartPoint :)

Abdou Ghr

Hey Jaime De Ascanio looks great! I was trying to achieve this by color transition with filter (on sides) but your solution is pretty clean. could you share the code by any chance? Thanks.

Read the entire post on Facebook