Bug Tracker

Opened 14 years ago

Closed 14 years ago

Last modified 11 years ago

#4616 closed bug (duplicate)

get .css() class style

Reported by: Panman01 Owned by:
Priority: major Milestone: 1.4
Component: unfiled Version: 1.3.2
Keywords: get, css, class, style Cc:
Blocked by: Blocking:

Description

I'm sure this has been reported, just can't find a bug.

Using .css() to get a style property doesn't work if the style was set via css class. However, it seems to work in Opera. I've also tried to get the .css('cssText') with no avail. Attached is a test case.

Attachments (1)

test.html (690 bytes) - added by Panman01 14 years ago.
Test Case for Bug

Download all attachments as: .zip

Change History (4)

Changed 14 years ago by Panman01

Attachment: test.html added

Test Case for Bug

comment:1 Changed 14 years ago by dmethvin

Shorthand properties aren't reported consistently by browsers, and jQuery doesn't try to normalize them. There are many cases where they *cannot* be normalized. Each side of the border can have a different width, color, and style, so there isn't always a "border" css property to report. If you are writing code and want it to work consistently with varied borders, you must get border-top-color, border-top-width, border-top-style, etc.

comment:2 Changed 14 years ago by Panman01

Ah, I never thought of that. I did try out .css('border-top-width') and that did work. If this is a feature that could be added, ex: if all border sides are eq... Thanks for your help!

comment:3 Changed 14 years ago by dmethvin

Resolution: duplicate
Status: newclosed

I'll close this as a duplicate of #4295 where it's being discussed in depth.

Note: See TracTickets for help on using tickets.