1.可用
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head><body>
<IFRAME id="test" name="test" frameBorder=0 scrolling=no src="" width="100%" height=0></IFRAME>
</body></html>
<SCRIPT FOR=window EVENT=onload LANGUAGE="JScript">document.all("test").height=test.document.body.scrollHeight;
</SCRIPT>
本文介绍了一种使用JScript自动调整网页中IFRAME元素高度的方法。通过设置IFRAME的ID和名称,并利用onload事件触发脚本来获取IFRAME内部文档的高度,从而实现IFRAME高度的自动适配。
3万+

被折叠的 条评论
为什么被折叠?



