Skip to main content

Bug Tracker

Side navigation

#7618 closed bug (wontfix)

Opened November 24, 2010 02:27PM UTC

Closed April 17, 2011 09:27PM UTC

Last modified October 02, 2011 08:03PM UTC

Get wrong dimensions of hidden elements

Reported by: fred.wuerges Owned by:
Priority: low Milestone:
Component: dimensions Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

As informed, the new released version of jQuery (1.4.4) came with a new feature where you can return the dimensions (width, height) of invisible elements, something that was not possible in previous versions.

But to test this new feature I had a surprise. Actually it is now possible to bring the dimensions of invisible elements, but unfortunately the value has wrong!

You can check the link below the test:

http://jsfiddle.net/VERw5/10/

First, that IE does not return value.

Second, the value it returns is the percentage of the width, and not the actual width of the element.

Attachments (0)
Change History (14)

Changed November 24, 2010 08:51PM UTC by jitter comment:1

component: unfileddimensions
milestone: 1.51.4.5
priority: undecidedhigh
status: newopen

Thanks for taking the time to contribute to the jQuery project by writing a bug report and providing a testcase!

adapted test case

Some results off browsers on this test:

  • Opera 10.63
  • returns wrong values on first test (20px off)
  • throws exception on second test (see also #7608)
  • FF 3.6.12:
  • returns wrong values on first test (20px off)
  • shows the defined value -> 95 instead off the calculated one -> 190
  • Chrome:
  • returns wrong values on first test (20px off)
  • shows the defined value -> 95 instead off the calculated one -> 190

Changed December 08, 2010 09:24PM UTC by jitter comment:2

milestone: 1.4.51.next
priority: highlow

Also check the comments on #7693 which is directly related. Especially the open question if innerHeight/Width, outerHeight/Width(true/false) support hidden elements at all (as jQuery nowhere claims to do so).

Changed December 09, 2010 12:31PM UTC by jitter comment:3

#7732 is a duplicate of this ticket.

Changed December 14, 2010 11:51PM UTC by jitter comment:4

#7781 is a duplicate of this ticket.

Changed December 15, 2010 02:22AM UTC by fred.wuerges comment:5

When is it expected to fix this bug?

It will be released in 1.4.5?

Changed January 02, 2011 09:12PM UTC by snover comment:6

There is no timeline on this bug. It is not scheduled for a release.

Changed January 10, 2011 05:40PM UTC by rwaldron comment:7

#7693 is a duplicate of this ticket.

Changed January 12, 2011 02:07AM UTC by dan@elearnapp.com comment:8

I made another jsFiddle test case here

http://jsfiddle.net/yt3fq/19/

Changed January 12, 2011 02:07AM UTC by dan@elearnapp.com comment:9

I made another jsFiddle test case here

http://jsfiddle.net/yt3fq/19/

Changed January 15, 2011 06:49PM UTC by jitter comment:10

#7983 is a duplicate of this ticket.

Changed February 10, 2011 03:40PM UTC by andrewstaffell@gmail.com comment:11

hello. I'm having trouble working out whether this is considered a bug which needs to be fixed, or not...

it does seem inconsistent and unhelpful that when an element (or its parent) is hidden, outerWidth() grabs the basic width but doesn't add on the border or margin, even if asked to. surely (given that it's so easy to calculate manually) this could be remedied without too much trouble, and the function would then behave consistently.

I've made another jsfiddle to demonstrate this:

http://jsfiddle.net/fewerflatlands/c2Ugu/2/

Changed April 17, 2011 09:27PM UTC by john comment:12

milestone: 1.6
resolution: → wontfix
status: openclosed

The case here is not one that we support - you're doing the tests on an element that's inside of an element that's display: none - the element itself isn't display: none (which is a different case and one that we support).

Changed June 08, 2011 05:38PM UTC by dmethvin comment:13

#9417 is a duplicate of this ticket.

Changed October 02, 2011 08:03PM UTC by timmywil comment:14

#10401 is a duplicate of this ticket.