一、demo
#body{width:70em;max-width:100%;margin:0 auto;
}iframe{width:100%;margin:0 0 1em;border:0;
}
/** When the iframe is on a different subdomain, uncomment the following line
* and change "example.com" to your domain.*/
//document.domain = "example.com";
functionsetIframeHeight(iframe) {if(iframe) {variframeWin=iframe.contentWindow||iframe.contentDocument.parentWindow;if(iframeWin.document.body) {
iframe.height=iframeWin.document.documentElement.scrollHeight||iframeWin.document.body.scrollHeight;
console.log(iframeWin.document.documentElement.scrollHeight , iframeWin.document.body.scrollHeight);
}
}
};