Iframe 自适应高度代码
来源:互联网 发布:阿里云终端管理 编辑:程序博客网 时间:2024/05/18 01:00
Iframe 自适应高度
code 1:
<div class="center" style="padding-left:10px">
//Iframe窗口自适应高度 兼容IE6.0、Chrome、FF3.0以上
<script type="text/javascript" language="javascript">
function iframeFitHeight(iframe)
{
try {
var win = iframe.name ? window.frames[iframe.name] : iframe.contentWindow;
iframe.style.height = win.document.body.scrollHeight + "px";
}
catch(e){}
}
</script>
//在iframer 的父窗口 利用onload() 事件进行调用
<iframe id="boxscore_content" name="boxscore_name" frameborder="0" width="100%" src="http://www.domain.com/includes/boxscore_today.php" onLoad="iframeFitHeight(this)"></iframe>
</div>
code 2:
使用jQuery autoHeight plugin来实现
基本代码:
<script type="text/javascript" src="jquery-1.2.6.js"></script>
<script type="text/javascript" src="autoHeight.js"></script>
<iframe src="http://www.domain.com/boxscore.php" width="300" frameborder="0" scrolling="auto" class="autoHeight" name="iframe"></iframe>
- Iframe 自适应高度代码
- [转]iframe自适应高度的代码
- jQuery解决iframe高度自适应代码
- Iframe高度自适应
- iframe 的自适应高度
- 是Iframe高度自适应
- iframe 的自适应高度
- iframe自适应高度
- Iframe自适应高度
- 让IFRAME自适应高度
- Iframe 自适应高度宽度
- iframe自适应高度
- iframe自适应高度
- Iframe自适应高度[摘]
- 让Iframe自适应高度
- IFRAME自适应高度
- iframe自适应高度[转]
- iframe自动自适应高度
- s3c2440学习系列4(uboot start.S说明)
- 图片加水印
- C# 多线程返回值
- 对上篇记事本程序作出的修改
- CSDN发表文章的控件功能怎么这么差
- Iframe 自适应高度代码
- 敏捷软件开发:原则模式与实践之笔记
- Common Administration Tasks
- 算法 - 折半查找(C#)
- 类似CSDN等级图片生成
- HTTP 知识点之一:头部解释(转)
- Verilog学习心得
- 使用yGuard保护你的代码
- 云计算之总结篇