Blueine
2018-05-01 16:35
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<script type="text/javascript">
var w=document.documentElement.clientWidth||document.body.clientWidth;
var h=document.documentElement.clientHeight||document.body.clientHeight;
document.write(w+"*"+h+"<br>")
var w=document.documentElement.clientWidth;
var h=document.documentElement.clientHeight;
document.write(w+"*"+h+"<br>")
var w=document.body.clientWidth;
var h=document.body.clientHeight;
document.write(w+"*"+h+"<br>")
var w=window.innerWidth;
var h=window.innerHeight;
document.write(w+"*"+h+"<br>")
var w=document.body.clientWidth;
var h=document.body.clientHeight;
document.write(w+"*"+h)
</script>
</body>
</html>
document.body.clientHeight 网页可见区域高
document.documentElement.clientHeight 是窗体高
JavaScript进阶篇
468060 学习 · 21891 问题
相似问题