iframe高度
作者:互联网
//主页面去除滚动条,仅iframe内有滚动条
var menuFrame = document.getElementById('menuFrame');
//赋予iframe初始高度
menuFrame.height = window.innerHeight - document.getElementById('navHeader').offsetHeight - document.getElementById('navFooter').offsetHeight;
//窗口大小变化时iframe高度随之变化
window.addEventListener('resize', function () {
menuFrame.height = window.innerHeight - document.getElementById('navHeader').offsetHeight - document.getElementById('navFooter').offsetHeight;
});
标签:高度,window,getElementById,iframe,offsetHeight,document,menuFrame 来源: https://www.cnblogs.com/vvull/p/15108034.html