我刚刚更新到最新版本的Chrome(17.0.963.56(,似乎window.document.height不再是一个有效的属性。还有其他人注意到这一点吗?我似乎找不到有关其删除的任何文档。
在使用 WebKit 提交错误后,我被告知document.height
不是标准属性,WebKit 是唯一维护的供应商支持它(直到现在。MDN 和 WebKit 现在都列出了属性已弃用,建议使用 document.body.clientHeight
或document.body.clientWidth
而不是 document.width
或document/height
.
我遇到了同样的问题,window.innerHeight
对我有用。文档在这里