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

What is Framer? Join the Community
Return to index
Robin Ait El Alim
Posted May 06 - Read on Facebook

Hey guys,

Is there a way that my BLUE layers inside of my GREEN scroll component have a position x and y not relative to the scroll component itself ?

Basically I would want to have the x of my blue layer be 550 ish instead of 10.

I tried to change the superlayers but if the scroll component and the layers didn't have the same superlayers, it doesn't work or maybe I did something wrong.

Thanks for your help :)


Eelco Lempsink

Hi Robin, the x and y position of a layer are always relative to the layer that contains it (the parent or superLayer). You can still calculate the numbers you want by adding the x of the parent(s) to the x of the layer.

Eelco Lempsink

Here’s a small example project that contains a function for calculating the ‘absolute’ position of a layer.

Robin Ait El Alim

Thank you so much man ! This is really helpful !!

Robin Ait El Alim

When I'm changing the position the layer is moving which is normal. Do you have a trick in mind to make the absolute position the regular position but without making the layer move ?

Eelco Lempsink

Yeah, you can basically use the same function and then use some handy (but undocumented) geometry utilities to calculate the relative position.

Here’s an updated project, click on the right layer to update its position:

Robin Ait El Alim

Thank you again Eelco Lempsink !!

Read the entire post on Facebook