Sean Catchpole wrote:
You bring up an excellent point. However if we can temporarily create
a unique className (say "jQueryAnimation"+timestamp) for the duration
of the animation, then specificty won't be a problem.
I don't want to discourage you from trying, but I think it's more
complicated than this. Specificity has to do with the number of id's,
the number of classes (and pseudo-classes), and the number of elements
in the selector. For instance,
"#myTable td.A" has a specificity of 100*
"tr td.A" has a specificity of 12
".jQueryAnim123" has a specificity of 10
".A" has a specificity of 10
so the first will overrule either of the others. And even the last one
will overrule the third one if it comes later in the stylesheet or in a
later sheet. Changing to unique IDs doesn't solve it either, because
any stylesheet may have a rule with several id selectors, which would
then overrule your dynamic one.
"#myDiv #myTable .A" ==> 210
"#jQueryAnim123" ==> 100
I'd love to see you find a way around this, but I'm not really hopeful.
Make sure you test early in FF, because I wouldn't be surprised if IE
gets this wrong.
Good luck,
-- Scott
* Assuming 10 is a big enough base for all selectors in our stylesheet.