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

What is Framer? Join the Community
Return to index
Danny Nathan
Posted Jun 02 - Read on Facebook

Is it possible to define a click event based on a layer name? For example, I have a grid of items created in a loop and then each layer named via an array. I want to make it so that if I click on Box1, go here; else if I click on Box 2, go there. For example, what I'm trying to do on line 118 onward, here:

2 Comments

Brent Riddell

i had a similar problem just the other day and its something to do with layers made in a loop aren't available to the global scope ... so try using this when making the layers in the loop:

window["layername")] = new Layer

then you can use layername.onTap or whatever event you want later. there are a few other ways around this as well, search for layers/loops etc in the framer group here, i found the answer there somewhere :) good luck! Hope it helps!

Brent Riddell

misread it a little, but maybe window["layername"] works for that to? :)

Read the entire post on Facebook