Opened 13 years ago
Closed 12 years ago
#5031 closed bug (worksforme)
height() returns 0 for children of hidden DIV (IE, Chrome, other brwsrs wasn't tested)
Reported by: | aavolkoff | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | core | Version: | 1.4.3 |
Keywords: | height hidden div | Cc: | |
Blocked by: | Blocking: |
Description
height(), innerHeight(), outerHeight() returns 0...
Code:
<div id="out" style="display:block"> </div>
<div id="in" style="display:none">
<div id="child">some text</div>
</div>
<script>
var kids = $("#in").children(); now array "kids" contains one DIV element named "child"
kids.each(function(index, domEle) {
$("#out").append($(domEle));
var height = $(domEle).height(); alert(domEle.tagName+" "+height+"px");
});
</script>
Result: Browser alert window says: "DIV 0px". It's wrong, because DIV height is 32px (or smth like that)...
But, if before alert() function I append DIV named "child" to DIV named "out" (in my example need to uncomment string) - all fine...
Change History (2)
comment:1 Changed 13 years ago by
Component: | unfilled → core |
---|
comment:2 Changed 12 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Version: | 1.3.2 → 1.4.3 |
Testing this using jQuery 1.4.3 Live Test Case this appears to be working fine now.