Possible Duplicate:
jQuery create CSS rule / class @ runtime
Is it possible to create & delete css classes with jQuery?
Please note I'm not talking about addClass
and removeClass
. I actually want to write a new class and delete old classes with jQuery.
The reason I ask is because I have a ton of animations that I'm trying to convert to CSS3 transitions. It gets a little hairy because the initial height
I set is dynamic, so I'm currently trying to change the classes from a class without transitions to one with transitions.
The problem is that CSS is so much faster than jQuery that even though I set the CSS setting first and then switch the classes, the new CSS setting is actually applied after the classes are switched (love transitions for that).
So, I'd like to dynamically create classes & add them then remove them & delete them.
If this isn't possible, does anyone know how to get around my dynamic CSS setting problem?