views:

38

answers:

1

It seems that firefox automatically combines things, such as it takes individual css values, such as for "border-color", "border-width" and dumps them all into "border".. this makes things a pain for jquery as the .css selector can only select the individual ones, like "border-color", not just "border" or "background".. I need to get the full value of "border" or "background" so that I can parse it to get the values I need.. I have read other posts and have tried the following but its not giving back the value:

test = $("#mydiv").attr("border");

Any advice is appreciated

+3  A: 

I think you want to do this instead:

test = $("#mydiv").css("border");

EDIT: ok you can use plain old javascript:

test = $("#mydiv")[0].style.border
spinon
@Rick just read your post better. I see what you are saying about css not pulling correctly. I have not noticed a problem with this but I will check it out real quick.
spinon
Grabbing the shorthand version like that work fine for me.
@smerriman here is the documentation from the css jquery docs. Shorthand CSS properties (e.g. margin, background, border) are not supported.
spinon
It says in the .css documentation for jquery that it can't get the shorthand, it doesn't work for me in trying that.. I will try the regular javascript way
Rick