Opened 10 years ago
Closed 10 years ago
#12870 closed bug (duplicate)
Provide method to get the actual comptued value of styles
Reported by: | jez | Owned by: | jez |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.8.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When you call jQuery.css("styleName"), there's some chance that jQuery might return the computed style which would be returned from the window.getComputedStyle(domElement) call. However, for various styles such as width and height, jQuery instead calls a 'hook' method, like the one defined in cssHookswidth?. The trouble is that these hooks aren't always desirable; with IE's sub-pixel rounding, for example, I want to get a computed width for an element which looks like "26.65px" and instead jQuery gives me "25px". Maybe jQuery's way is useful for something, but jQuery should provide a way to always get the computed style, as returned by the browser.
Change History (6)
comment:1 Changed 10 years ago by
comment:3 Changed 10 years ago by
Owner: | set to jez |
---|---|
Status: | new → pending |
I agree with gibson042, why not use the native styles if that what you want? What's the use case here?
comment:5 Changed 10 years ago by
Status: | pending → new |
---|
gibson042: You might as well ask why should jQuery provide you with any style information via .css(). It's for convenience, just like everything else in jQuery - it would be convenient for me to be able to just quickly get computed style information for a jQuery DOM object.
comment:6 Changed 10 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Duplicate of #9628.
If your fer-instance is the actual and only issue, then this is a dup.
That should say jQuery.css(domElement, "styleName") above.