You don't need jquery inside the iframe to do this, but I use it cause the code is so much simpler...
Put this in the document inside your iframe.
$(document).ready(function() {
parent.set_size(this.body.offsetHeight + 5 + "px");
});
added five above to eliminate scrollbar on small windows, it's never perfect on size.
And this inside your parent document.
function set_size(ht)
{
$("#iframeId").css('height',ht);
}