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

What is Framer? Join the Community
Return to index
Daniel Caine
Posted Dec 04 - Read on Facebook

Hi guys,

I'm not the greatest at Javascript (understatement), and I'm trying to figure out how to loop through an existing layer group, and re-create the individual groups, up to a certain point.

The code below shows how to create new layers which run vertically down a newsfeed:

# Create and style the cards within a for-loop
for i in [0...10]
layer = new Layer
backgroundColor: "#fff",
width: scroll.width - 48, height: 400
x: 24, y: (400 + 32) * i
borderRadius: 6, superLayer: scroll.content = "0 1px 6px rgba(0,0,0,0.2)"

But I'm looking at removing the styling code and simply re-insert an existing layer group which has been imported from Sketch.

Any ideas?



Daniel Caine

Ok thing I just messaged you. @mamezito, right?

Read the entire post on Facebook