jQuery Dynamic iFrame height based on content

This method only works when the iFrame shares the same domain as the parent domain.
$('iframe').load(function() {
	var height = jq(this)[0].contentWindow.document.body.scrollHeight + 24;
	$(this).animate( { height: height });
Posted by
Snippet Viewed 5575 times.

Share your jQuery code snippets:

  • Get some recognition & a link back to your site.
  • Create your own code library.
  • Help your fellow developers, as they have helped you.


Submit | Browse

Most Recent jquery snippets

Most Viewed