posts - 710,  comments - 81,  views - 260万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

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的高度。

  

 程序员的基础教程:菜鸟程序员

posted on   itprobie-菜鸟程序员  阅读(382)  评论(0编辑  收藏  举报
编辑推荐:
· 分享一个我遇到过的“量子力学”级别的BUG。
· Linux系列:如何调试 malloc 的底层源码
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
阅读排行:
· 历时 8 年,我冲上开源榜前 8 了!
· Apifox不支持离线,Apipost可以!
· 分享一个我遇到过的“量子力学”级别的BUG。
· 工作面试必备:SQL 中的各种连接 JOIN 的区别总结!
· 物流快递公司核心技术能力-海量大数据处理技术
点击右上角即可分享
微信分享提示