#9417 closed bug (duplicate)
dimensions are unretrievable on an element whose parent is hidden and does not have any styles set
Reported by: | samuel | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | dimensions | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked by: | #9300 | Blocking: |
Description
<span id="test" style="display:none;">ffffff</span> $("#test").width() OK
but <div id="mydiv" style="display:none;"> <span id="test"> ffffff</span> </div>
$("#test").width() is 0 Error
I can`t get the width when the span in a hidden div
Change History (5)
comment:1 Changed 12 years ago by
Blocked by: | 9300 added |
---|---|
Component: | unfiled → dimensions |
Priority: | undecided → low |
Status: | new → open |
Version: | 1.4.2 → 1.6.1 |
comment:2 Changed 12 years ago by
I suppose instead of doing jQuery.swap() on the element itself, we could jQuery.swap all the "display:none;" parents of the element as well... that's a brute force approach, but it may work?
comment:3 Changed 12 years ago by
Summary: | a bug on "width()" → dimensions are unretrievable on an element whose parent is hidden and does not have any styles set |
---|
comment:4 Changed 12 years ago by
Resolution: | → duplicate |
---|---|
Status: | open → closed |
I think we decided this was too gruesome to handle long ago. Mike Sherov's method will often work but would potentially be very slow in the general case. I don't think we'd want to be an enabler of bad practice.
http://jsfiddle.net/timmywil/S8H2w/1/
It would be great if we could get this working, but it's not easy.
Related to #9300. This is different in that this element does not have a width set in its styles to retrieve as a fallback.