iframe 自适应内容高度
来源:互联网 发布:java语法 编辑:程序博客网 时间:2024/05/10 06:10
<iframe src="home.aspx" name="frmContent" id="frmContent" allowtransparency="true"
frameborder="0" scrolling="no" onload="setIFrameHeight();"
style="display:block; clear:both; width:100%; height:100%;" ></iframe>
<script type="text/javascript">
$(document).ready(function(){
setIFrameHeight();
});
function setIFrameHeight(){
$(this).height(0); //用于每次刷新时控制IFRAME高度初始化
var height = $(this).contents().height() + 10;
$(this).height( height < 500 ? 500 : height );
});
}
</script>
-------------------------------
如果页面中有编辑器,并且设置了编辑器高度,那就要注意控件和编辑器高度要一致,否则iframe无法自适应高度。
<style type="text/css">
#detail { width: 80%; height: 400px; }
</style>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "exact",
elements : "detail",
theme : "advanced",
language : "zh",
width: 680,
height: 400,
......
});
</script>
<textarea id="detail" runat="server"></textarea>
- iframe 自适应内容高度
- iframe 自适应内容高度
- iframe高度自适应内容
- iframe高度自适应内容
- IFrame自适应内容高度
- IFrame根据内容自适应高度
- IFrame 根据内容自适应高度
- iframe自适应框架内容高度
- iframe根据内容自适应高度
- iframe里面内容高度自适应
- 实现iFrame自适应高度 适应内容高度
- Iframe自适应其加载的内容高度
- Iframe自适应其加载的内容高度
- Iframe自适应其加载的内容高度
- Iframe自适应其加载的内容高度
- Iframe自适应其加载的内容高度
- iframe自适应内容高度的处理方法
- iframe根据内容自适应高度教程
- seg cs 的使用
- 蒙特卡罗(Monte Carlo)方法
- AIX 5L 磁盘性能优化
- C语言中条件编译命令(#if #else #endif)(
- powerdesigner生成HTML
- iframe 自适应内容高度
- js获取select标签选中的值
- wpf passwordbox 不能绑定问题
- HttpClient 学习整理
- JavaScript跨域总结与解决办法
- C++ 注册表编程
- T_Sql 交叉连接以及查询等等 暑假第二天
- ARM926EJ-S/ARM920T 协处理器 CP14, CP15详解
- hdu 1711 KMP算法练习