blog已經轉移至github,大家請訪問 http://qaseven.github.io/
window.screen 對象包含有關用戶屏幕的信息。
window.screen 對象在編寫時可以不使用 window 這個前綴。
一些屬性:
screen.availWidth 屬性返回訪問者屏幕的寬度,以像素計,減去界面特性,比如窗口任務欄。
返回您的屏幕的可用寬度:
<script> document.write("可用寬度:" + screen.availWidth); </script>
screen.availWidth
以上代碼輸出為:
可用寬度:1366
親自試一試
screen.availHeight 屬性返回訪問者屏幕的高度,以像素計,減去界面特性,比如窗口任務欄。
返回您的屏幕的可用高度:
<script> document.write("可用高度:" + screen.availHeight); </script>
screen.availHeight
可用高度:738
posted on 2014-04-01 14:10 順其自然EVO 閱讀(202) 評論(0) 編輯 收藏 所屬分類: js
Powered by: BlogJava Copyright © 順其自然EVO