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

What is Framer? Join the Community
Return to index
Sergey Shandarin
Posted Feb 20 - Read on Facebook

Hi. I have a basic question. How to check if layer is in certain state?

What I’m trying to do: https://framer.cloud/uwiQr/ (using properties)

Button shows up on mouseover, dropdown shows up on click on the button and both stay on the screen until dropdown is closed.

What I’m getting using states: https://framer.cloud/hPfUO/

The button doesn’t work correctly because something is wrong with this part:

$.group.onMouseOut ->
if $.dropdown.state = "on"
$.hover_button.animate("on")
else
$.hover_button.animate("off")

What’s the correct way to check if dropdown is in "on" state?

2 Comments

Jordan Robert Dobson

print layer.states.current.name

Sergey Shandarin

Ok, I got the name part. But I can't make it work like first example. Button doesn't hide. Even if dropdown.states.current.name is not "on". Any ideas why? https://framer.cloud/hPfUO/

Read the entire post on Facebook