<iframe frameborder="0" src="https://ipkd.cn/" class="iframe" frameborder="0" id="test" onload="this.height=100" width="762px" scrolling="no"></iframe><script type="text/javascript">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.max(bHeight, dHeight);iframe.height = height;console.log(height);}catch (ex){}}window.setInterval("reinitIframe()", 200);</script> 以上是编程学习网小编为您介绍的“iframe框架调用高度自适应方法”的全面内容,想了解更多关于 vuejs 内容,请继续关注编程基础学习网。
本文标题为:iframe框架调用高度自适应方法


基础教程推荐
- js鼠标移动时禁止选中文字 2023-12-29
- nginx cookie有效期讨论小结 2024-03-08
- 利用CSS3新特性创建透明边框三角 2022-11-16
- 使用Jquery Aajx访问WCF服务(GET、POST、PUT、DELETE) 2023-12-19
- html5通过postMessage进行跨域通信的方法 2022-09-16
- 一个JavaScript获取元素当前高度的实例 2023-12-21
- css display table 自适应高度、宽度问题的解决 2024-01-24
- js鼠标点击图片实现随机变换图片的方法 2023-12-21
- js实现点击向下展开的下拉菜单效果代码 2024-01-25
- Web Components入门教程示例详解 2023-08-08