获取浏览器窗口的高度和宽度(不包括工具栏/滚动条)

<body class="body_bj">
</body>

<script>
var h = document.body.clientHeight;
console.log(h);
realh = h - 50;
$(".body_bj").css("background-size","100%"+realh+"px");
</script>
var w=window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;

var h=window.innerHeight
|| document.documentElement.clientHeight
|| document.body.clientHeight;

 

posted @ 2020-11-17 15:42  大熊童鞋  阅读(476)  评论(0编辑  收藏  举报