Last active
August 29, 2015 14:16
-
-
Save abrjagad/802da76c9e5a6063f9d6 to your computer and use it in GitHub Desktop.
adjust the width and height of iframe
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
function autoResize(id) { | |
var newheight; | |
var newwidth; | |
var id = document.getElementById(id); | |
newheight = id.contentWindow.document.body.scrollHeight; | |
newwidth = id.contentWindow.document.body.scrollWidth; | |
id.height = newheight + "px"; | |
id.width = newwidth + "px"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment