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 例子 ...
随机推荐
- Android如何使用Https
什么是Https? HTTPS(全称:Hyper Text Transfer Protocol over Secure Socket Layer),是以安全为目标的HTTP通道,简单讲是HTTP的安全 ...
- 常用数据库2 sqlite及SQL注入
知识内容: 1.sqlite数据库介绍 2.sqlite数据库操作 3.SQL注入 一.sqlite数据库介绍 1.sqlite数据库 sqlite数据库:轻量级的数据库,一般开发中使用sqlite数 ...
- 逆地址解析协议RARP
解决的问题 一般系统启动时,从引导磁盘中获取ip 有些机器没有引导磁盘,如X终端或无盘工作站,则需要采用其他方法来获得IP地址 解决的过程 无盘系统依据RARP协议 从接口卡上读取唯一的硬件地址,然后 ...
- centos7.3nginx配置二级域名过程
nginx1.10.2 1先检查 /etc/nginx/nginx.conf 是否include conf.d include /etc/nginx/conf.d/*.conf; 默认都是包含的,如 ...
- 尝试了一些时间,最简单的apache上设置用IP访问一个虚拟目录
就是其实新建一个 多域名访问的设置 <VirtualHost *:80> DocumentRoot /var/www/ ServerName IP</VirtualHost> ...
- SQL SERVER2008 DBX Error: Driver could not be properly initialized
raised exception class TDBXError with message 'DBX Error: Driver could not be properly initialized. ...
- 怎样把代码复制到word中并保持颜色
- Gradle 语法
参考文章: Gradle学习系列之二——创建Task的多种方法(http://www.cnblogs.com/CloudTeng/p/3417970.html) Gradle基本知识点与常用配置(ht ...
- js--语音播报
一.借用百度接口 function speckText(){ var str = "请及时预警!"; //var request= new URLRequest(); var ur ...
- WP 8.1 status bar
A status bar is the bar showing signal, battery and time on the top of the phone's screen. In WP8.1 ...