<iframe
src="https://www.baidu.com/"
scrolling="no"
name="main"
frameborder="0"
id="main"
style="min-height:3584px;width:100%;height:100%;"
></iframe>
<script>
function calcPageHeight(doc) {
var cHeight = Math.max(
doc.body.clientHeight,
doc.documentElement.clientHeight
);
var sHeight = Math.max(
doc.body.scrollHeight,
doc.documentElement.scrollHeight
);
var height = Math.max(cHeight, sHeight);
return height;
}
var ifr = document.getElementById("main");
ifr.onload = function() {
ifr.style.height = "0px";
var iDoc = ifr.contentDocument || ifr.document;
var height = calcPageHeight(iDoc);
if (height < 850) {
height = 850;
}
ifr.style.height = height + "px";
};
</script>
<script>