function getInfo() {
var s = "";
s += " 网页可见区域宽:"+ document.body.clientWidth;
s += " 网页可见区域高:"+ document.body.clientHeight;
s += " 网页可见区域宽:"+ document.body.offsetWidth + "||" + document.documentElement.clientWidth + " (包括边线和滚动条的宽,Chrome不包括滚动条)";
s += " 网页可视区域宽:"+ window.innerWidth + " (除了IE以外,包括滚动条)";
s += " 网页可见区域高:"+ document.body.offsetHeight + " (包括边线的高,Chrome包括滚动条)";
s += " 网页可见区域高:"+ window.innerHeight + " (Chrome包括滚动条)";
s += " 网页正文全文宽:"+ document.body.scrollWidth;
s += " 网页正文全文高:"+ document.body.scrollHeight;
s += " \n网页被卷去的高(ff):"+ document.body.scrollTop;
s += " 网页被卷去的高(ie):"+ document.documentElement.scrollTop;
s += " 网页被卷去的左:"+ document.body.scrollLeft;
s += " 网页正文部分上:"+ window.screenTop;
s += " 网页正文部分左:"+ window.screenLeft;
s += " \n屏幕分辨率的高:"+ window.screen.height;
s += " 屏幕分辨率的宽:"+ window.screen.width;
s += " 屏幕可用工作区高度:"+ window.screen.availHeight;
s += " 屏幕可用工作区宽度:"+ window.screen.availWidth;
s += " 你的屏幕设置是 "+ window.screen.colorDepth +" 位彩色";
s += " 你的屏幕设置 "+ window.screen.deviceXDPI +" 像素/英寸";
console.log (s);
}
function getScrollTop()
{
var scrollTop = 0;
if(document.documentElement && document.documentElement.scrollTop)
{
scrollTop = document.documentElement.scrollTop;
}
else if(document.body)
{
scrollTop = document.body.scrollTop;
}
return scrollTop;
}
function getScrollWidth() {
var noScroll, scroll, oDiv = document.createElement("DIV");
oDiv.style.cssText = "position:absolute;top:-100px;width:100px;height:100px; overflow:hidden;";
noScroll = document.body.appendChild(oDiv).clientWidth;
oDiv.style.overflowY = "scroll";
scroll = oDiv.clientWidth;
document.body.removeChild(oDiv);
return noScroll-scroll;
}
function setPaddingR (tag1,tag2,width){
if(!$(tag1)[0]){
return
}
if($(tag1)[0].scrollHeight>$(tag1)[0].clientHeight || $(tag1)[0].offsetHeight > $(tag1)[0].clientHeight){
$(tag2).css("padding-right",width || "17px");
}else{
$(tag2).css("padding-right","0");
}
};
function getClientHeight()
{
var clientHeight = 0;
if(document.body.clientHeight && document.documentElement.clientHeight)
{
var clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight:document.documentElement.clientHeight;
}
else
{
var clientHeight = (document.body.clientHeight > document.documentElement.clientHeight) ? document.body.clientHeight:document.documentElement.clientHeight;
}
return clientHeight;
}
function getScrollHeight()
{
return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
}