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

What is Framer? Join the Community
Return to index
Dean Hudson
Posted Nov 03 - Read on Facebook

I want to make the background for each button map to a specific color on tap. What am I doing wrong here?

2 Comments

Joe Howard

Add “do (i) ->” in the onTap function before you set the backgroundColor. JavaScript is weird can’t pass the correct value to each iteration of the loop.

Jordan Robert Dobson

Add to the custom property when you create it.

You can store whatever you want in there an not worry about Framer ever messing with this property.

...
backgroundColor: colors[5]
custom: colorID: i

Then in your onTap event...

@.backgroundColor = colors[@.custom.colorID]

Read the entire post on Facebook