function initHeight() {
var ifm = document.getElementById("commIframe");
var subWeb = document.frames ? document.frames["commIframe"].document : ifm.contentDocument;
if (ifm != null && subWeb != null) {
ifm.height = window.screen.height;
}
}
Iframe自适应高度
最新推荐文章于 2024-03-29 11:18:46 发布
本文介绍了一种使用JavaScript来初始化页面中iframe元素高度的方法。通过获取iframe元素及子文档,将其高度设置为当前屏幕的高度,实现自适应布局。
5246

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



