Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@buley
Last active August 29, 2015 14:04
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 buley/6f40aad6552489d08357 to your computer and use it in GitHub Desktop.
Save buley/6f40aad6552489d08357 to your computer and use it in GitHub Desktop.
self-expanding iframe
window.parent.document.body.style.height = window.parent.innerHeight + 'px';
window.parent.document.getElementsByTagName('iframe')[0].setAttribute('height', window.parent.document.body.clientHeight +'px');
window.parent.document.getElementsByTagName('iframe')[0].setAttribute('width', window.parent.document.body.clientWidth + 'px');
window.document.getElementById("application-ad-handle").style.margin = ((document.body.clientHeight - window.document.getElementById("application-ad-handle").clientHeight)/2) + 'px auto 0 auto';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment