auto adjust ifram height

This commit is contained in:
r0n1n7an 2023-11-26 13:54:14 +08:00
parent 8a940330e2
commit 3f7ac44875
2 changed files with 9 additions and 2 deletions

Binary file not shown.

View File

@ -8,8 +8,15 @@
ul,li {margin: 0px; padding: 0px; list-style-type: none;}
label {font-family: Consolas; font-size: 16px;}
input {width: 250px; height: 20px; font-family: monospace; font-size: 14px;}
iframe {word-wrap: break-word; position: static; border: 0; top: 0px; left: 0px; min-width: 1000px; min-height: 1000px;}
iframe {word-wrap: break-word; position: static; border: 0; top: 0px; left: 0px; width: 100%;}
</style>
<script>
function adjustIFrame() {
var ifm= document.getElementById("result");
//ifm.contentWindow.document.body.scrollHeight;
ifm.height = ifm.contentWindow.document.documentElement.scrollHeight;
}
</script>
</head>
<body leftmargin="10px" >
<h4>机台测试记录查询</h4>
@ -24,6 +31,6 @@
</ul>
</form>
<br/>
<iframe title="result" name="result" frameborder="no" marginwidth="0" marginheight="0"></iframe>
<iframe title="result" name="result" id="result" scrolling="no" onload="adjustIFrame();"></iframe>
</body>
</html>