I have a div containing text that is inside another div, displayed only under certain circumstances. HTML for this is simple and looks like this:
<div id='parent'> <div id='child'> Some text inside child div </div> </div>
The style will look like this:
#parent{ display:none; height:0px; }
Using jQuery, I would like to get the height of the child, as if the div were outside the parent.
The following javascript returns 0, I want something around, maybe 15.
var child_height = $('#child').height(); alert(child_height);
Matte source share