Skip to content

Instantly share code, notes, and snippets.

@dtan
Created December 8, 2010 20:10
Show Gist options
  • Save dtan/733829 to your computer and use it in GitHub Desktop.
Save dtan/733829 to your computer and use it in GitHub Desktop.
sniff out iframe and resize
(function (window) {
function sendChangeHeightMessage() {
var newHeight = window.location.search.substring(1),
par = window.parent.parent,
frameId = 'iframe_sparq',
el = par.document.getElementById(frameId);
if (el != null) {
if (newHeight != "") {
//alert(window.location.search.substring(1));
el.height = newHeight + "px";
}
}
}
window.onload = sendChangeHeightMessage;
})(window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment