Bug Tracker

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:


height(), innerHeight(), outerHeight() returns 0...


<div id="out" style="display:block"> </div>

<div id="in" style="display:none">

<div id="child">some text</div>



var kids = $("#in").children(); now array "kids" contains one DIV element named "child"

kids.each(function(index, domEle) {


var height = $(domEle).height(); alert(domEle.tagName+" "+height+"px");



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 dmethvin

Component: unfilledcore

comment:2 Changed 12 years ago by addyosmani

Resolution: worksforme
Status: newclosed

Testing this using jQuery 1.4.3 Live Test Case this appears to be working fine now.

Note: See TracTickets for help on using tickets.