iframe父窗口和子窗口之间的调用
1>父窗口获取子窗口
js方法
document.getElementById('if1').contentWindow.document;
window.frames["if1"].document.body;
jQuery方法
$(this).contents();
2>父窗口获取子窗口高度
js方法
document.getElementById('if1').contentWindow.document.body.scrollHeight;
window.frames["if1"].document.body.scrollHeight;
jQuery方法
$(this).contents()[0].body.scrollHeight;
3>子窗口调用父窗口方法
js方法
window.parent.fun();
4>iframe自适应高度
在iframe的load事件中重新设置iframe的高度。
$(function () {
$("iframe").each(function () {
$(this).load(function () {
$(this).height($(this).contents()[0].body.scrollHeight);
});
});
});
程序员的基础教程:菜鸟程序员
iframe父窗口和子窗口之间的调用的更多相关文章
- Iframe父页面与子页面之间的调用
原文:Iframe父页面与子页面之间的调用 Iframe父页面与子页面之间的调用 专业词语解释如下: Iframe:iframe元素是文档中的文档. window对象: 浏览器会在其打 ...
- Iframe父页面与子页面之间的相互调用
iframe元素就是文档中的文档. window对象: 浏览器会在其打开一个HTML文档时创建一个对应的window对象.但是,如果一个文档定义了一个或者多个框架(即:包含一个或者多个frame或者i ...
- iframe 父页面与子页面之间的方法的相互调用
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- iframe 父页面与子页面之间的方法的相互调用【转】
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- JavaScript(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作
一.Iframe 篇 公共部分 //父对象得到子窗口的值 //ObjectID是窗口标识,ContentID是元素ID function GetValue(ObjectID,ContentID) { ...
- 总结JavaScript(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作
一.Iframe 篇 //&&&&&&&&&&&&&&&&&&a ...
- 总结js(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作
http://hi.baidu.com/yashua839/blog/item/131fdb2fe547ef221f3089af.html一.Iframe 篇 //&&&&am ...
- HTML中IFrame父窗口与子窗口相互操作
一.Iframe篇 //&&&&&&&&&&&&&&&&&&am ...
- iframe父窗口和子窗口的调用方法
iframe 父窗口和子窗口的调用方法父窗口调用子窗口 iframe_name.iframe_document_object.object_attribute = attribute_value 例子 ...
随机推荐
- Effect
/////////////////////////////////shader source/////////////////////////////////Texture2D colorMap : ...
- php 数组随机取值
array_rand()在你想从数组中取出一个或多个随机的单元时相当有用.它接受 input 作为输入数组和一个可选的参数 num_req,指明了你想取出多少个单元 - 如果没有指定,默认为 1. a ...
- vs2017诊断工具
vs2017诊断工具
- tcp 大文件上传 ,切换目录 及登陆文件加盐处理
实现大文件的传输 服务器 import socketimport jsonimport structsk = socket.socket()sk.bind(("127.0.0.1" ...
- Oracle 存储过程 延迟执行 DBMS_LOCK.SLEEP(60);
--测试代码: declare -- Local variables here i integer; begin -- Test statements here dbms_output.put_l ...
- ORM sqlachemy学习
内容: 1.ORM介绍 2.SQLAlchemy介绍 3.SQLAlchemy内部处理 4.SQLAlchemy使用 参考: http://www.cnblogs.com/wupeiqi/articl ...
- 关系型数据库之Mysql
简介 主要知识点包括:能够与mysql建立连接,创建数据库.表,分别从图形界面与脚本界面两个方面讲解 相关的知识点包括:E-R关系模型,数据库的3范式,mysql中数据字段的类型,字段约束 数据库的操 ...
- 8.rem适配
<!DOCTYPE html> <!--lang="en" : 英语 :声明当前页面的语言类型.--> <html lang="en&quo ...
- 1.Redis的应用场景
转自:http://www.runoob.com/redis/redis-tutorial.html Redis开创了一种新的数据存储思路,使用Redis,我们不用在面对功能单调的数据库时,把精力放在 ...
- VBA 操作 VBE
Introduction You can write code in VBA that reads or modifies other VBA projects, modules, or proced ...