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.
精彩评论