#14022 closed bug (notabug)
$(selector).css('width') returns wrong value
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.10.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
$(selector).css('width') returns the elements actual width not it's css width property. For example
Change History (3)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
jQuery.fn.css getter returns computed but not relative value, but i agree, documentation might be more clear on that – https://github.com/jquery/api.jquery.com/issues/326
comment:3 Changed 10 years ago by
Seems like javascript can't actually get css properties only used values, but yeah the docs do read like you can. Maybe it needs to explain about used values. https://developer.mozilla.org/en-US/docs/Web/CSS/used_value?redirectlocale=en-US&redirectslug=CSS%2Fused_value
Note: See
TracTickets for help on using
tickets.
http://jsfiddle.net/MznAU/
shows that it gives the actual width value in pixels of the element and not it's css property of 100% percent. The docs say that .css returns css properties not rendered sizes.