When loading pages in an iframe, you are likely to run into cross-domain access issues. Access to the page inside the iframe from the parent JS is blocked.
If you want to make it easy - keep track of what is loaded in the iframe in your code, and manually resize it to hard-coded sizes.
Create an array of dimensions that you want to use for each page, and use this function:
function() {
var i = document.getElementById('myIframe');
var sr=i.src;
i.style.width = myDimensionsArray[sr][w]+"px";
i.style.height = myDimensionsArray[sr][h]+"px";
}
source
share