//返回页面的高度
function pageHeight() {
if (window.innerHeight && window.scrollMaxY) { yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight) { yScroll = document.body.scrollHeight; } else { yScroll = document.body.offsetHeight; }
return yScroll;
}
//返回页面的宽度
function pageWidth() {
if (window.innerWidth && window.scrollMaxX) { xScroll = window.innerWidth + window.scrollMaxX; } else if (document.body.scrollWidth > document.body.offsetWidth) { xScroll = document.body.scrollWidth; } else { xScroll = document.body.offsetWidth; }
return xScroll;
}
//返回浏览器的高度
function windowHeight() {
return (window.innerHeight) ? window.innerHeight : (document.documentElement && document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.offsetHeight;
}
//返回浏览器的宽度
function windowWidth() {
return (window.innerWidth) ? window.innerWidth : (document.documentElement && document.documentElement.clientWidth) ? document.documentElement.clientWidth : document.body.offsetWidth;
}