Thanks! That looks to be just the solution I'm looking for.
On Nov 27, 1:10 pm, seasoup <[EMAIL PROTECTED]> wrote:
> ok, found a plugin for you:
>
> http://flesler.webs.com/jQuery.Rule/
>
> On Nov 26, 4:40 pm, Craig <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi, does anyone know if it's possible to ext
ok, found a plugin for you:
http://flesler.webs.com/jQuery.Rule/
On Nov 26, 4:40 pm, Craig <[EMAIL PROTECTED]> wrote:
> Hi, does anyone know if it's possible to extract a style attribute
> from a style (and not an element)?
> For instance:
>
> .myclass { background-color:white; }
>
>
> I hav
I don't think jQuery is designed to get an attribute from a class.
The code you wrote
...
var color = $(".myclass").css("background-color");
works by pulling the background color from the DOM object. A
different hack that would work in one line:
$('').addClass('myclass').css('background-color
You could access the CSS rules via document.stylesheets[x].cssRules
[x].style.color, for example, but cross-browser support is not very
good:
http://www.quirksmode.org/dom/w3c_css.html
- ricardo
On Nov 26, 10:40 pm, Craig <[EMAIL PROTECTED]> wrote:
> Hi, does anyone know if it's possible to ext
I don't think there's anyway to directly reference what's in a style
declaration, only indirectly through an html element (as you found).
However, you could temporarily create an element, assign the class of
interest to it, and work with that. Of course, you probably want to
'learn' what classes
5 matches
Mail list logo