Created
November 4, 2015 10:34
-
-
Save srinathweb/880507ef22c6c1d526ec to your computer and use it in GitHub Desktop.
iframe width
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this to your <head> section | |
<script language="javascript" type="text/javascript"> | |
function resizeIframe(obj) { | |
obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px'; | |
} | |
</script> | |
And change your iframe to this: | |
<iframe name="Stack" src="http://stackoverflow.com/" frameborder="0" scrolling="no" id="iframe" onload='javascript:resizeIframe(this);' /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment