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

What is Framer? Join the Community
Return to index
Dae Hyuk Yoon
Posted Jun 25 - Read on Facebook

Hey guys, I would like to animate a layer when state of the other layer changes. I tried "StateDidChange" and "StateWillChange" without any luck. Any idea?

4 Comments

Dae Hyuk Yoon

here is the part of the code

SideNav.on(Events.StateDidSwitch, function() {
Feed3.animate({
properties: {
x: 300
}
})
})

Tisho Georgiev

Events.StateDidSwitch is called on the layer's states property, not the layer itself. So your code should read:

SideNav.states.on(Events.StateDidSwitch, function() {...

Dae Hyuk Yoon

Thanks a lot Tisho! It worked.

Rob Jones

Definitely could use more info on these methods in the docs http://framerjs.com/docs.html#events

Read the entire post on Facebook