JavaScript中screen对象的两个属性
Screen 对象
Screen 对象包含有关客户端显示屏幕的信息。
这里说一下今天用到的两个属性:availHeigth,availWidth
avaiHeigth返回显示屏幕的高度 (除 Windows 任务栏之外)。
语法:screen.availHeigth
实例:
<html>
<body>
<script type="text/javascript">
document.write("<p>Available Height: ")
document.write(screen.availHeight + "</p>")
</script>
</body>
</html>
availWidth:返回显示屏幕的宽度 (除 Windows 任务栏之外)。
语法screen.availWidth
实例
<html>
<body>
<script type="text/javascript">
document.write("<p>Available Width: ")
document.write(screen.availWidth + "</p>")
</script>
</body>
</html>

浙公网安备 33010602011771号