如何使用 jQuery 从 iFrame 中获取父窗口的高度? [英] How can I get a parent window's height from within iFrame using jQuery?

查看:57
本文介绍了如何使用 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.

jQuery is not needed.

parent.document.body.clientHeight

这对我来说适用于 IE7 和 FF3.

That works for me with IE7 and FF3.

这篇关于如何使用 jQuery 从 iFrame 中获取父窗口的高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆