Assuming you have another Text element with the ID “debugme” this elements text would change to the ID of the group element. Which if unassigned would be something like “hype-obj-KEH274K3H493SU”
All of this can be put in a function run from the “On Mouse Down (touchstart)” action in the inspector if you need to have touchstart or you can use it in the way you have been BUT “.unbind” has been discouraged since jQuery 1.7 so I would use “.off” instead.
I am also not fully sure what you are trying to do but…
I would give each marker a class ‘marker’
Then run your function on sceneload.
The function binds all the click touchstart events.
It also just looks for the closest ‘.marker’ class. Which should be the parent.
What I am trying to do is trigger certain events depending on the value of a variable, I want to assign the variable a value equal to each button group ID.
This is because I need to use the same function for all buttons. So, the only way I
So
if (mymarker == "marker_1") {
// Do Marker 1 stuff
}
if (mymarker == "marker_2") {
// Do Marker 2 stuff
}
And so on. Since Im going to need about 100 buttons, I just want to use 1 single code for each one, and using the parent ID as a way to differentiate each one.
What I originally want to do is to find a way that all elements with a .listoptions class, when clicked, they assign their parents ID into a variable.
This is the structure I am using:
The reason the click works within an element in the group, is because I only need that element to change color, not the whole group bg.