This commit is contained in:
daihh
2023-03-02 13:04:29 +08:00
parent 0e76147559
commit 6c00f96a0d

View File

@@ -581,12 +581,20 @@
setTimeout(function(){
var scormIframe=document.getElementById('iframe-scorm');
if (scormIframe) {
var iframeWin = scormIframe.contentWindow || scormIframe.contentDocument.parentWindow;
if (iframeWin.document.body) {
scormIframe.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
}
let iframeWin = scormIframe.contentWindow;
let iframeDoc = scormIframe.contentDocument || scormIframe.document;
let cHeight = Math.max(iframeDoc.body.clientHeight,iframeDoc.documentElement.clientHeight);
let sHeight = Math.max(iframeDoc.body. scrollHeight,iframeDoc.documentElement.scrollHeight);
let winHeight = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
let lheight = Math.max(cHeight, sHeight);
let finalHeight = Math.max(lheight, winHeight );
scormIframe.height =finalHeight;
console.log('scormIframe.height',scormIframe.height);
}
},500);
},1500);
},
loadMyScore(){