如题
<script>
import $ from "jquery";
export default {
mounted() {
function reinitIframe(){
var iframe = document.getElementById("test");
try{
var bHeight = iframe.contentWindow.document.body.scrollHeight;
var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
var height = Math.min(bHeight, dHeight);
iframe.height = height;
/* console.log(iframe.contentWindow);
console.log(bHeight,dHeight);*/
}catch (ex){}
};
setInterval(reinitIframe,100);
}
};
</script>
我这样写的,希望对你有帮助
4 回答4.6k 阅读✓ 已解决
4 回答2.1k 阅读✓ 已解决
4 回答2.2k 阅读✓ 已解决
3 回答5k 阅读
2 回答2.6k 阅读✓ 已解决
1 回答3.1k 阅读✓ 已解决
2 回答1.2k 阅读✓ 已解决
宽高100% 相对定位(position:absolute)设置top,left,bottom:0