function reinitIframe(){
//$("#external-frame").height = $(document.body).height();
try{
var iframe = document.getElementById("external-frame");
if(iframe.attachEvent){
iframe.attachEvent("onload", function(){
iframe.height = iframe.contentWindow.document.documentElement.scrollHeight;
});
return;
}else{
iframe.onload = function(){
iframe.height = iframe.contentDocument.body.scrollHeight;
};
return;
}
}catch(e){
throw new Error('setIframeHeight Error');
}
}
Iframe自适应记录
最新推荐文章于 2022-02-24 11:39:02 发布