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

What is Framer? Join the Community
Return to index
Mark J Harvey
Posted Jul 15 - Read on Facebook

I am trying to draw an overlay with new Layer in framer for popup / modal overlays. For some reason the placeBehind or placeBefore properties are being ignored. Any ideas as to why?

overlay = new Layer
width: screen.width , height: screen.height
backgroundColor: "#000", opacity:0.3
overlay.placeBehind(layerItShouldBeBehind)

5 Comments

Chris Camargo

Do these two layers share a common superLayer, or are they removed from superLayers altogether? If not, this will not work.

Mark J Harvey

not too familiar with what superLayers are and how to use them :(

Văn Công Bằng

superLayers are parent of subLayer, for example, layerA is superLayer of layerB, it means that layerB is inside layerA, layerB is subLayer (or child) of layer A, 1 layer can have many subLayers (or children) if you update Framer studio to 1.12.5, you can see the layers tree. To say layerA is superLayer of layerB: layerB.superLayer = layerA or layerA.addSubLayer(layerB)

Chris Camargo

Mark, when you have questions about basic elements or properties Framer, the docs are there to help. The superLayer property is well documented. But basically, what Văn says above is correct. A superLayer is just a parent layer to any other layer. If your layers have two different parent layers, the placeBehind and placeBefore methods will not work.

Mark J Harvey

Thanks for your help guys. I find the docs to not be that helpful when my code just won't do what i want. Maybe it's the context but I figured it out

Read the entire post on Facebook