I’ve got a bit of an issue with a script I’m playing about with. I’m trying to draw triangles that when you click on them "flip" around and change colour and if clicked again they revert to their initial state. The problem is I’m not sure where to set the isflipped variable.
Does anyone have any ideas/has anyone come up with a problem like this before? Here’s what I have at the moment:
You can save values in a map with index of elements as key e.g.
other alternative is to use jquery data API to attach data with elements e.g.
first init flipped value per element
than on click toggle it
I have updated example with that
http://jsfiddle.net/anuraguniyal/hnqB6/38/