js如何获取可见区域的宽度和高度

来源:互联网 发布:教打字软件 编辑:程序博客网 时间:2024/05/28 11:49
<script type="text/javascript">
// 获得可见区域宽度
var width = document.documentElement.clientWidth;
// 获得可见区域的高度
var height = document.documentElement.clientHeight;
alert(height);

</script>
原创粉丝点击