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

What is Framer? Join the Community
Return to index
Maxence Le Corre
Posted Oct 20 - Read on Facebook

Hi,

I'm trying a very simple animation here. The expected behaviour is to have the layer at the top being horizontally centered after being clicked thanks to the following property:

midX: Framer.Device.screen.width/2

Once in a while it does. But most of the times it gets left aligned.
Also I'm wondering why we cannot use the Align function on midX / midY / maxX / maxY. Wouldn't it be more convenient if we could? I'm guessing there might be reasons behind this limitation (some other recommended practices maybe).

2 Comments

Dan Bartley

Heya mate, you can't move the layer by changing it's midX because the midX is only affected by the width of the layer, not the x value.

Just set the x value to the center and minus half the width of the layer: http://share.framerjs.com/7g3iu6aybadh/

Maxence Le Corre

Thanks for answering Dan! 👍🏽

Read the entire post on Facebook