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

What is Framer? Join the Community
Return to index
Shirley Man
Posted May 17 - Read on Facebook

I am having trouble using a simple for-loop to attach on click events to my layers. I would like to animate the square that receives the click event (onClick->Scale 2x), but the 'layer' variable always points to the second square. Something obvious I am missing?

4 Comments

Balraj Chana

Just replace layer.animate with this.animate: http://share.framerjs.com/7z3y5uvuct9e/

Shirley Man

Awesome. Do you know why layer doesn't work in this case?

Andy Ngo

Shirley Man I think the issue that you face is similar to this here: https://www.facebook.com/groups/framerjs/permalink/674118236048584/

Shirley Man

Thanks for your help. Fixed my prototype. http://share.framerjs.com/g1dj499cf9cz/

Read the entire post on Facebook