如何使用jQuery从iFrame中获取父窗口的高度? [英] How can I get a parent window's height from within iFrame using jQuery?
本文介绍了如何使用jQuery从iFrame中获取父窗口的高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在iFrame中,我们需要获取父窗口/文档的高度。
Within an iFrame, we need to get the parent's window/document height.
有没有办法使用jQuery来获取这个?
Is there a way to get this using jQuery?
我知道我们可以使用$(document).height()来获取页面的高度。我不知道如何从iFrame中获取父母的价值。
I know we can use $(document).height() to get a page's height. I just can't figure out how to get the parent's value from within the iFrame.
请帮助!
推荐答案
不需要jQuery。
parent.document.body.clientHeight
这适用于我与IE7和FF3。
That works for me with IE7 and FF3.
这篇关于如何使用jQuery从iFrame中获取父窗口的高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文