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

What is Framer? Join the Community
Return to index
Joe Toscano
Posted Apr 15 - Read on Facebook

Probably a really basic question (sorry I'm really new to Framer — not new to code tho), but how do I use "this" in Framer? I'm trying to create a dynamic animation function.

Here's the code I'm using.. basically just trying to make a box shadow appear when buttons are hovered.

4 Comments

George Kedenburg III

to do something like this you'd want to either put all the layers in a loop and apply the animation to them that way, or make a function and pass the layer to the function on mouseover

Aalok Trivedi

I believe this refers to the layer the event is on.
you won't be able to use 'this' in the way you have it because 'this' isn't referring to any layer.

learnHow.onMouseOver ->
this.animate
...
"this" refers to learnHow

Joe Toscano

Just made it like this so any button I add to the array gets the animation.. couldn't have done it without your help George Kedenburg III!!

Jörg Lehmann

the equivalent of 'this' in coffeescript is "@"

Read the entire post on Facebook