js获取屏幕,浏览器,body的宽高

console.log("屏幕宽度"+screen.width,"屏幕的高度"+screen.height);
console.log("屏幕宽度"+screen.availWidth,"去除任务栏的屏幕的高度"+screen.availHeight);
console.log("浏览器宽度"+window.outerWidth,"浏览器的高度"+window.outerHeight);
console.log("页面可用宽度"+window.innerWidth,"页面可用高度:"+window.innerHeight);
console.log("body展示宽度"+document.documentElement.clientWidth,"body展示高度:"+document.documentElement.clientHeight);
console.log("body总宽度"+document.documentElement.scrollWidth,"body总高度:"+document.documentElement.scrollHeight);

posted @ 2018-01-16 15:23  yuan纷飞  阅读(825)  评论(0编辑  收藏  举报