Skip to main content

Bug Tracker

Side navigation

#14022 closed bug (notabug)

Opened June 14, 2013 10:55AM UTC

Closed June 14, 2013 10:00PM UTC

Last modified June 15, 2013 11:36AM UTC

$(selector).css('width') returns wrong value

Reported by: jonny.rimes@gmail.com 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

Attachments (0)
Change History (3)

Changed June 14, 2013 11:00AM UTC by jonny.rimes@gmail.com comment:1

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.

Changed June 14, 2013 10:00PM UTC by markelog comment:2

resolution: → notabug
status: newclosed

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

Changed June 15, 2013 11:36AM UTC by anonymous comment:3

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