可见的窗口高度,而不是$(window).height(); [英] Visible window height instead of $(window).height();

查看:91
本文介绍了可见的窗口高度,而不是$(window).height();的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过iframe获取整个页面的可见高度,$(window).height()给我iframe的高度?

Is there any way to get the visible height of the whole page from inside an iframe, $(window).height() gives me the iframes height?

推荐答案

如果使用框架,则可以通过使用jQuery构造函数中的window.top来获取最外面的窗口的高度. window.top 的高度将获得浏览器窗口的高度.

If you are using frames, you can get the height of the outermost window by using window.top in the jQuery constructor. The height of window.top will get the height of the browser window.

$(window.top).height();

当Mozilla移动其文档时,更新了window.top参考.

Updated window.top reference as Mozilla moved their documentation around.

这篇关于可见的窗口高度,而不是$(window).height();的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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