// iframe已加载完毕
if (iframe.attachEvent) {
iframe.attachEvent('onload', function () {
let offsetHeight = document.getElementById('iframe').contentWindow.document.documentElement.offsetHeight;
that.iframeHeight = offsetHeight;
})
} else {
iframe.onload = function () {
// iframe加载完毕以后执行操作
let offsetHeight = document.getElementById('iframe').contentWindow.document.documentElement.offsetHeight;
that.iframeHeight = offsetHeight;
}
}
网友评论