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

What is Framer? Join the Community
Return to index
Bil Chamberlin
Posted Aug 22 - Read on Facebook

Hey all, how I can write a condition using states? toggle.onMouseOver ->
if toggle.state = "a"
then change property
else do nothing

I want to do a rollover state for a simple toggle but I cant get the syntax

https://framer.cloud/HGGRt

thanks

5 Comments

Lukas Guschlbauer

The correct syntax is:
if toggle.states.current.name is "a"

Bil Chamberlin

thanks

Gilbert Han

Unexpected if will be present before you finish entire if statement.

Bil Chamberlin

toggle_all.onMouseOver ->
if toggle.states.current.name is "left"
toggle.borderColor: "rgba(99,153,184,1)"
else
toggle.borderColor: "rgba(117,117,117,1)"

Bil Chamberlin

thanks, you guys are the best

Read the entire post on Facebook