Just quickly (I haven't got time atm to slap an example codepen together), is there a way to toggle the CSS className attribute?
I have an object that's being manipulated a lot, and one of the tweens is removing a class from an element, and animating it's new position accordingly.
This works fine, until I reverse the timeline... At which point the class isn't re-added to object, and obviously, no animation occurs, resulting in a broken reverse animation.
I know I can remove the "-=", but that overwrites all the classes on the element in question as well, which is again, undesirable and dangerous to maintain.
Is there a toggle for ClassName that I simply haven't come across before? Much like JQuery's $(e).toggleClass('someClass')?
If not, is it a possibility for the future?
Thanks a lot!