當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
【javascript位置属性】screen对象
生活随笔
收集整理的這篇文章主要介紹了
【javascript位置属性】screen对象
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
screen對象
- availHeight
- availWidth
- height
- width
| availHeight | 返回屏幕的高度【window任務欄除外】 |
| availWidth | 返回屏幕的寬度【window任務欄除外】 |
| height | 返回屏幕的高度 |
| width | 返回屏幕的寬度 |
?
瀏覽器兼容性:
實例代碼:
<script?type="text/javascript">
document.write("Available?Height:?"?+?screen.availHeight+"<br/>"+
"Available?Width:"+screen.availWidth+"<br/>"+
"Height:"+screen.height+"<br/>"+
"width:"+screen.width);
</script>
?
效果實現:
AvailableHeight:?770
AvailableWidth:1280
Height:800
width:1280
?
分????析:
由運行結果可以知道window任務欄的高度是30px
?
轉載于:https://www.cnblogs.com/kycool/archive/2011/12/04/2275244.html
總結
以上是生活随笔為你收集整理的【javascript位置属性】screen对象的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SharePoint Foundatio
- 下一篇: 月光博客 - 再谈软件保护中软加密和硬加