Bug Tracker

Modify

Ticket #7419 (closed bug: duplicate)

Opened 3 years ago

Last modified 15 months ago

css() function returns physical height/width rather than the CSS attribute value when 100%

Reported by: paul.crowder@… Owned by:
Priority: undecided Milestone: 1.5
Component: css Version: 1.4.3
Keywords: Cc:
Blocking: Blocked by:

Description

When an element has its height or width CSS attribute set to "100%", the jQuery css() function returns the physical bounds of the element rather than the CSS attribute value. In version 1.4.2 the css() function returned "100%" as expected.

Example (toggle between version 1.4.2 and 1.4.3 to see the difference in behavior):  http://jsfiddle.net/MXEvc/

Change History

comment:1 Changed 3 years ago by anonymous

Note that I was able to duplicate the issue in the following browsers on Windows 7:

  • Chrome 7.0
  • Firefox 3.6
  • IE 8
  • Opera 10.6

comment:2 Changed 3 years ago by rwaldron

  • Status changed from new to closed
  • Resolution set to duplicate
  • Component changed from unfiled to css

This is fixed in 1.4.4rc2

comment:3 Changed 3 years ago by rwaldron

Duplicate of #7395.

comment:4 Changed 3 years ago by Xotic750

I wouldn't say fixed but in #7283 it was stated that:

this is definitely the desired result now

Though, in all versions that I have used (1.2.6, 1.3.2, 1.4.2) until 1.4.3, the query of inline css using

.css("width")

would always return the text value, i.e. 50% or 1em etc.rather than a calculated pixel value.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.