JavaScript Window Screen
Javascript 教程
· 2019-03-03 08:41:59
window.screen 对象包含有关用户屏幕的信息。
Window Screen
window.screen对象在编写时可以不使用 window 这个前缀。
一些属性:
- screen.availWidth - 可用的屏幕宽度
- screen.availHeight - 可用的屏幕高度
Window Screen 可用宽度
screen.availWidth 属性返回访问者屏幕的宽度,以像素计,减去界面特性,比如窗口任务栏。
实例
返回您的屏幕的可用宽度:
<script>
document.write("可用宽度: " + screen.availWidth);
</script>
document.write("可用宽度: " + screen.availWidth);
</script>
以上代码输出为:
Window Screen 可用高度
screen.availHeight 属性返回访问者屏幕的高度,以像素计,减去界面特性,比如窗口任务栏。
实例
返回您的屏幕的可用高度:
<script>
document.write("可用高度: " + screen.availHeight);
</script>
document.write("可用高度: " + screen.availHeight);
</script>
以上代码将输出:
点击查看所有 Javascript 教程 文章: https://www.codercto.com/courses/l/27.html
Data Structures and Algorithms with JavaScript
Michael McMillan / O'Reilly Media / 2014-2-22 / USD 28.51
If you’re using JavaScript on the server-side, you need to implement classic data structures that conventional object-oriented programs (such as C# and Java) provide. This practical book shows you how......一起来看看 《Data Structures and Algorithms with JavaScript》 这本书的介绍吧!