Erik, you haven't been very specific.
For example, if 'parent' is a fixed percentage height of 'grandparent' then it is simple maths to set the percentage height of child in CSS, no JS required.
Otherwise, with jQuery if you want child to be 25% height of grandparent:
var grandparent_height = $('#grandparent').height();
$('#child').height( grandparent_height * 0.25 );
Is there more to your question than that?
If you are looking to set the size of child relative to the viewport and you are happy working with modern browsers only, then you can use the CSS vh unit (1vh is 1% of the viewport height), and set
#child {
height: 25vh;
}
Different browsers can return different results when measuring viewport size. Here is a good resource (and javascript library) about the different browser treatment: http://verge.airve.com/ )