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

What is Framer? Join the Community
Return to index
Scott Herrington
Posted Sep 05 - Read on Facebook

Help setting event on layers within a class

prototype: https://framer.cloud/FfvwB/

Hi guys, need some help with adding interactivity to a checkbox component I made by expanding the native Layer class.

I want to be able to:
Tap any of the checkListOption layers inside the loop - and that means the whole layer, so anywhere between the divider lines.

On tap the checkMark should be revealed within the checkBox AND the checkListOption backgroundcolor should change to smoke (a shade of grey I saved as. a variable).

Right now I've got a click event working only on the checkBox to reveal the checkMark inside... and I can't work out how in the same event to change the background of the parent class.

But that's not what I want anyway. I'd like the tap event on the parent checkListOption, and for the checkMark to then appear in the checkBox and the entire background colour of the checkListOption to change.

Any help greatley appreciated! Hopefully the code is easy enough to follow :)

1 Comments

Scott Herrington

Update: so I used the lodash defaults function to merge the provided options with our own defaults as detailed here: https://framer.com/getstarted/guides/programming/#classes

Getting hold of stuff seems a lot easier now and I've got the behaviour I'm looking for :)

Read the entire post on Facebook