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

What is Framer? Join the Community
Return to index
Richard Sellies
Posted May 09 - Read on Facebook

Hi all, I'm trying to swap between two states (Or animation) every time you click on a object. But I'm not getting the code right. Ive look everywhere and still not understanding it :/
y: -0
y: -1485

nav.menubtn.onTap (event, Layer) ->


Krijn Rijshouwer

Hey Richard Sellies ,

It is pretty easy. You can already give the default Layer the properties for the closed state if you want so you won't have to make an extra state for it. In the case which I think you are looking for this will save you some code. This will also enable you to type which should not contain any parameters or all the states you would like to toggle through.

Then there is also states.switch() which lets you switch to a certain state. I made you some examples. Let me know if anything is still unclear. example → multiple example → parameters →
States.switch →

Read the entire post on Facebook