如何在javascript中检测窗口的全部高度

How to detect FULL height of window in javascript

本文关键字:窗口 全部 高度 检测 javascript      更新时间:2023-09-26

如何在javascript中检测屏幕的全高度?这包括Y-Overflow。到目前为止,我还没有找到一个脚本。

document.body.offsetHeight

$('body').height();

如果你使用jQuery

试试这个:

function pageWidth() {return window.innerWidth != null? window.innerWidth: document.body != null? document.body.clientWidth:null;}
function pageHeight() {return window.innerHeight != null? window.innerHeight: document.body != null? document.body.clientHeight:null;} 

你指的是页面内容的高度吗?