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

What is Framer? Join the Community
Return to index
Huy Nguyễn
Posted May 05 - Read on Facebook

Hey guys,

Is there any way we could get to the origin state for a layer?

So I have this case

originState -> click(open) -> stateA -> click(close) -> stateB -> originState

I thought that we could use card.states.current("...") but I don't know what to fill into the quote marks.

Thank you!


Tri Nguyen

I guess you can use the switch function to get to the state that you want.
E.g: LayerName.states.switch("OriginState")

Basically you can switch to any define states in the layer that you want

Amrit Mazumder

The initial state of everything is called 'default'

Krijn Rijshouwer

Hey Huy Nguyễn,

You can do this by calling layerA.states.switch("default"). Here's an example →

Tri Nguyen

and don't forget to reset to default state after animation end by calling layer.onAnimationEnd -> layerB.states.switchInstant("stageName")

Read the entire post on Facebook