Skip to content

Instantly share code, notes, and snippets.

@wmh
Created August 21, 2009 03:33
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 wmh/171638 to your computer and use it in GitHub Desktop.
Save wmh/171638 to your computer and use it in GitHub Desktop.
//-- change iframe height and width
//child: <body onload="getIframeSize()">
//for child
function getIframeSize() {
if (document.getElementById){
var t = document.getElementById("t");
try {
parent.wh("loginForm", t.offsetWidth, t.offsetHeight);
} catch (e) {
//alert("ERROR!");
}
}
}
//for parent
function wh(obj, w, h) {
if (h <= 43) h = 43;
if (el(obj)) {
el(obj).style.height = h;
//el(obj).style.width = w;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment