iframe 高度自适应
2024-10-12 05:39:12
<iframe id="InputDetail" src style="width:100%"></iframe>
<script>//iframe高度自适应,方法
function reinitIframe(thisIframe)
{
var iframe = document.getElementById(thisIframe);
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('InputDetail')", 200);
</script>
参考博客:iframe高度自适应的6个方法
最新文章
- zw.delphi不同版本程序运行速度测试
- Atitit qzone qq空间博客自动点赞与评论工具的设计与实现
- Pyqt QDockWidget 停靠窗体
- Selenium2学习-018-WebUI自动化实战实例-016-自动化脚本编写过程中的登录验证码问题
- thinkPHP3.2.3完整版 在sae上面的部署
- python第一个hello world注意问题!!
- Javascript手记-基本类型和引用类型
- 聊聊iOS开发中耳机的那点事(监听耳机拔插、耳机线控)-b
- css 文本两端对齐
- Computer Graphics Thinking–texture tiling
- JavaScript快速入门(一)——JavaScript概览
- Linq左关联 右关联 内关联
- ORACLE_INSERT
- shiro的入门实例-shiro于spring的整合
- word中正文分栏重新换页问题
- tensorflow 学习日志
- 我的 FPGA 学习历程(11)—— 实验:按键消抖
- nginx是什么,如何使用
- CSS3帧动画
- .join() ----- 是把列表中的元素用 ";xx";.join() 拼接成字符串