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

What is Framer? Join the Community
Return to index
Matthijs Otterloo
Posted Apr 26 - Read on Facebook

Hi everyone!

I'm trying to change a state based on an hover action.
For this I'm using the following code:

screens.thomasgmail.onMouseOver ->
screens.thomasgmail.states.switch("hidden")
screens.thomashover.states.switch("visible")
print "MouseOver"

screens.thomasgmail.onMouseOut ->
screens.thomasgmail.states.switch("visible")
screens.thomashover.states.switch("hidden")
print "MouseOut"

(Print is just for debugging this issue).
Changing the states just replaces the images, if I hove over the "thomasgmail" layer it keeps changing really quick between the old and the new one. Also the log shows:

» "MouseOver"
» "MouseOut"
» "MouseOver"
» "MouseOut"
» "MouseOver"
» "MouseOut"
» "MouseOver"
» "MouseOut"

Any idea on how to solve this? Is it a bug?

Cheers!

Matthijs

4 Comments

Floris Verloop

It could be that when you hide the "thomasgmail" layer, the onMouseOut event triggers because it's no longer visible. What happens in the "hidden" state exactly?

Matthijs Otterloo

Oh yeah! That could be right! In the hidden state the layer will be hidden.

Matthijs Otterloo

Solved it! Thanks Floris :)

Koen Bok

#protip you can use this snippet to quickly debug which layer gets clicked: https://share.framerjs.com/gpnedgis8m2t/

Read the entire post on Facebook