Yeah, I gave up on dealing with stylesheets at all and added a method to
pass a CSS string to override such as:  {color:"ff0000",etc}

On 3/19/07, Nathan Young -X (natyoung - Artizen at Cisco) <
[EMAIL PROTECTED]> wrote:

Hi.

> > if (ElementInQuestion.style.fontSize == "13px"){whatever}
>
> That will only work if font-size has been declared in the style
> attribute of that element.

My understanding is that if the element font-size is set to 13px, this
will return true, no matter where the rule was declared (weather in
included stylesheet, style element, or style attribute).

> You need to use getComputedStyle and its IE counterpart for

I agree testing styles directly could give you perceived false negatives
that testing computed value might avoid.  For example where the font is
visually 13px but it got to be that size because it was set using a
percent value, this test would give a false result.

The overall point is that there are so many ways to style an element
that the most reliable way to tell if your user has written a rule about
an element is to set a baseline on the types of formatting you care
about and then check them to see if they've changed.

Paradoxically this may obviate the original need as I understood it,
since if you're setting defaults and letting your users override them as
needed, you already have most of a working model in place without the
use of JS at all.

------->Nathan

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to