I have this jsfiddle and I am trying to call different functions using object keys.
i.e.
var LaneWizard = {
targets: {
Lane: $('.lane-colors span'),
AltLane: $('.alt-lane-colors span')
},
prepTargets: function() {
for(var t in LaneWizard.targets) {
LaneWizard.targets[t].on('click', function() {
LaneWizard['change'+t+'Color']($(this));
});
}
}
}
In the example, there are two (2) concentric circles. The outer circle should be controlled by the first row (Lane Color) and the inner circle by the second row (Alternate Lane Colors).
I can't figure out why they are all changing the color of the inner circle.