Hi gang,
I’m using jQuery to add and remove classes to some buttons so that I can set the background-color of some rectangles. “Wait, why don’t you just animate them?” Because with a class I can set it once and tweak it later without having to tweak 40 keyframes. I’m meeting with enough success to get excited (I’m easily amused, what can I say) but not enough to put it to bed.
Here I have three buttons to talk about some of the issues, I have 3 groups of two elements in them, the symbol and the rectangle. The rectangle should change color when selected, so Im using :nth-child to grab the second child of the group.
$(element).click(function(){
$(this).children(':nth-child(1)').addClass("selected");
});
The Add works fine - but I can’t figure out how to remove .selected from the other two elements. You can see in the file itself I’ve been working through permutations of .next…
The Toggle works fine, though it requires a double-click(!). This appears to be a common issue.
The Remove (which has removeClass) doesn’t work at all, which is just strange.
@DBear, I tried your hypeDocument.getElementProperty solution, but it doesn’t appear I can change the background-color element, according to the docs which you kindly linked to.
All advice and insight welcome-
removeClass.hype.zip (50.4 KB)