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

What is Framer? Join the Community
Return to index
Rafael T Balbi Jr.
Posted Oct 11 - Read on Facebook

Noob question: Why won't reclicking the layer once it's state is 'off' switch it back to 'on' with this if/else statement?


Jordan Robert Dobson

You want to use current... not just .states

Arron J Hunt

Also just a heads up, this could be simplified to $.Check_1.states.switch("on", "off")

Jordan Robert Dobson

You'd want to write it like this
if $.Check_1.states is "on"
  $.Check_1.states.switchInstant "off"
  $.Check_1.states.switchInstant "on"

Andrew Nalband

Or even $

Jordan Robert Dobson

Yep... or that.

Jordan Robert Dobson

I was trying to get him the correct syntax first of all..

Rafael T Balbi Jr.

thanks Guys...super helpful!

Justin McDonald

The dollar sign there is just a variable name, right?

German Bauer

also you say "if states... _=_ " instead of _==_, ,the former which assigns a value, not compares.

Rafael T Balbi Jr.

Thanks everyone for being so supportive. I dabbled quite a bit this weekend and feel more grounded in the language and framework. Will present full prototypes to team this week. Always great to see supportive communities, this will really help the ushering in of Framer as the industry standard to prototyping tools.

Read the entire post on Facebook