开发者

How to detect FULL height of window in javascript

How can I detect the full height of a screen in javascript? This includes the Y-Overfl开发者_JAVA百科ow. So far, I haven't been able to find a script for it.


document.body.offsetHeight

or

$('body').height();

if you're using jQuery


Try this:

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;} 


Do you mean the height of the page content? If so, this should do the job.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜