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:
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 comment:1
component: | unfiled → dimensions |
---|---|
milestone: | 1.5 → 1.4.5 |
priority: | undecided → high |
status: | new → open |
Changed December 08, 2010 09:24PM UTC by comment:2
milestone: | 1.4.5 → 1.next |
---|---|
priority: | high → low |
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 15, 2010 02:22AM UTC by 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 comment:6
There is no timeline on this bug. It is not scheduled for a release.
Changed January 12, 2011 02:07AM UTC by comment:8
I made another jsFiddle test case here
Changed January 12, 2011 02:07AM UTC by comment:9
I made another jsFiddle test case here
Changed January 15, 2011 06:49PM UTC by comment:10
#7983 is a duplicate of this ticket.
Changed February 10, 2011 03:40PM UTC by 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:
Changed April 17, 2011 09:27PM UTC by comment:12
milestone: | 1.6 |
---|---|
resolution: | → wontfix |
status: | open → closed |
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 comment:13
#9417 is a duplicate of this ticket.
Changed October 02, 2011 08:03PM UTC by comment:14
#10401 is a duplicate of this ticket.
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: