代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html lang="sv">
<head>
<meta charset="utf-8" />
<title>Iframe height demo</title>
<style media="screen,print">
#body {
width: 70em;
max-width: 100%;
margin: 0 auto;
}
iframe {
width: 100%;
margin: 0 0 1em;
border: 0;
}
</style>
<script>
/*
* When the iframe is on a different subdomain, uncomment the following line
* and change "example.com" to your domain.
*/
// document.domain = "example.com";
function setIframeHeight(iframe) {
console.log(iframe)
if (iframe) {
console.log(iframe.contentWindow)
console.log(iframe.contentWindow.document.documentElement.scrollHeight)
var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
if (iframeWin.document.body) {
iframe.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
}
}
};
window.onload = function () {
setIframeHeight(document.getElementById('external-frame'));
};
</script>
</head>
<body>
<div id="body">
<h1>Iframe height demo</h1>
<h2><code>iframe</code> <strong>without</strong> height adjustment</h2>
<iframe src="backtop.html"></iframe>
<h2><code>iframe</code> <strong>with</strong> height adjustment</h2>
<iframe id="frame_content" name="frame_content" src="https://developer.juphoon.com/portal/reference/V2.3/android/classcom_1_1juphoon_1_1cloud_1_1_j_c_client.html" width="100%" height="0" scrolling="no" frameborder="0"></iframe>
<iframe src="https://developer.juphoon.com/portal/reference/V2.3/android/classcom_1_1juphoon_1_1cloud_1_1_j_c_client.html" frameborder="0" id="external-frame"></iframe>
<div id="labfooter">
</div>
</div>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。