Skip to content

Instantly share code, notes, and snippets.

@redecs
Created September 17, 2012 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redecs/3736890 to your computer and use it in GitHub Desktop.
Save redecs/3736890 to your computer and use it in GitHub Desktop.
jQuery auto-height for frame - works even if the js is in the footer
$('frame.auto-height').on('load', function(e) {
this.style.height = (parseInt(this.contentWindow.document.body.offsetHeight) + 100) + 'px';
}).each(function() {
this.style.height = (parseInt(this.contentWindow.document.body.offsetHeight) + 100) + 'px';
return false;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment