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

What is Framer? Join the Community
Return to index
Noam Elbaz
Posted Nov 20 - Read on Facebook

Loving Framer!
see the last line of the code... it just prints "Default"
How do I get it to sense which STATE is currently visible.
Maybe I'm not using .current correctly.

7 Comments

Benjamin Den Boer

Hmm, you could either put the print declaration within the TouchEnd function or use:

superLayer.on Events.StateDidSwitch, ->
...

Noam Elbaz

i dont want to print anything, I want to a momentum-y scroll that as it slows down snaps in to which ever box is visible. Maybe I should not use states for that....and instead just use "y" value and create a range and snap to the closest box.

Noam Elbaz

What does .StateDidSwitch do?

Benjamin Den Boer

It fires after the layer has switched states.

Noam Elbaz

Sounds like it might help. Thanks.

Noam Elbaz

.StateDidSwitch should also work with .next() and .previous() ?

Benjamin Den Boer

Yes, it also fires after switching with next/previous.

Read the entire post on Facebook