[jQuery] Static vs dynamic CSS rules

[jQuery] Static vs dynamic CSS rules


> I've bumped into an issue whereby converting the "static"
> CSS rules in the <head>to their "dynamic" jQuery equiv
Possibly the problem is with the bare float name? Javascript has reserved
"float" as a keyword. I've never had to set it myself in JQuery but John
mentioned it in a blog entry:
http://jquery.com/blog/2006/02/23/bugs-squished-ajax-on-the-way/
It may be even a bit more complicated than that, some pages indicate that
Firefox uses cssFloat as an alias but IE uses styleFloat for the same thing.
Maybe you can get away with just quoting the word "float" there, it's worth
a try. Let us know!
-----Original Message-----
From: discuss-bounces@jquery.com [mailto:discuss-bounces@jquery.com] On
Behalf Of Mark Constable
Sent: Sunday, May 07, 2006 8:41 AM
To: jQuery Discussion.
Subject: [jQuery] Static vs dynamic CSS rules
I'm playing around with the tabs example from Michal Tatarynowiczs'
lovely jQuery_Auto package and I've bumped into an issue whereby converting
the "static" CSS rules in the <head>to their "dynamic"
jQuery equiv mostly works but when it comes time to removeClass or addClass
then any CSS rules no longer work. I've bumped into this before but now I
have an example to point to...
This is a mildly hacked version with the style rules in the <head>, and
where the Active class is applied it works (the tabs update as they should
when the Active class is added or removed)...
http://markc.renta.net/jquery/tabs_static_css.html
This is an example of translating the the above <head> CSS rules to their
jQuery $().css() equivalents (the tabs no longer get updated but all else
works)...
http://markc.renta.net/jquery/tabs_dynamic_css.html
No doubt I am missing an obvious point but could anyone point out why this
is so and how to work around it, if possible ?
Would it be better to a create a single string of a whole bunch of rules and
append them to a <style> tag directly in the <head> perhaps (to more closely
emulate the "static" rules) ?
* Firefox shows some debug at the bottom, Konqueror does not
(no idea if that debug <div> shows up in other browsers).
--markc
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/