Skip to content

Instantly share code, notes, and snippets.

@yicone
Created July 24, 2013 07:24
Show Gist options
  • Save yicone/6068651 to your computer and use it in GitHub Desktop.
Save yicone/6068651 to your computer and use it in GitHub Desktop.
Old Old autoSetFrameHeight
function autoSetFrameHeight(name) {
try {
var iframe;
if (!name) return;
iframe = document.getElementById(name);
if (iframe.contentDocument)
$("#" + name).height(iframe.contentDocument.height + "px");
else
$("#" + name).height(document.frames[name].document.body.scrollHeight + "px");
} catch (e) {
// alert(e.message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment