#7618 closed bug (wontfix)
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.
Change History (14)
comment:1 Changed 13 years ago by
Component: | unfiled → dimensions |
---|---|
Milestone: | 1.5 → 1.4.5 |
Priority: | undecided → high |
Status: | new → open |
comment:2 Changed 13 years ago by
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).
comment:5 Changed 12 years ago by
When is it expected to fix this bug? It will be released in 1.4.5?
comment:6 Changed 12 years ago by
There is no timeline on this bug. It is not scheduled for a release.
comment:11 Changed 12 years ago by
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/
comment:12 Changed 12 years ago by
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).
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: