开发者

How to detect FULL height of window in javascript

开发者 https://www.devze.com 2023-03-19 12:03 出处:网络
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

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

精彩评论

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

关注公众号