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

What is Framer? Join the Community
Return to index
JT White
Posted Oct 21 - Read on Facebook

Hey guys, I'm sure this has come up before but I couldn't find an answer.

I'm trying to create two states for every layer in a loop, but for some reason the states are only affecting the last layer in the loop, and nothing else. Any ideas?


Anton Jarl

The layer divider is overwritten all the time, thats why only the last layer gets the states. You could do a new loop where you iterate through the layers and add the states but use @states.add instead. That should work. @ means "self" in this case.

Anton Jarl

But share the prototype and we can have a look!

Florian Pnn

Maybe using "do ->" will solve your problem?

JT White

Anton Jarl Florian Pnn here's the prototype

JT White

Anton Jarl, sorry what would I replace with @states.add??

Chris Camargo

JT White, here's what you're looking for. Just take states.add out of your for loop and place it in another for loop, where it will cycle over each sublayer of nav, and add states to each.

JT White

Chris Camargo and Anton Jarl thanks so much for your reply. Unfortunately I'm still struggling to create the new loop... Any chance you could quickly jump into my prototype and show me?

JT White

Chris Camargo Anton Jarl nevermind - figured it out. Thanks for the help1!!!!!

JT White

Anton Jarl Here's the solution I came up with

Read the entire post on Facebook