當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
JS中获得窗口属性的方法
生活随笔
收集整理的這篇文章主要介紹了
JS中获得窗口属性的方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1。獲得屏幕的分辨率:
screen.width
screen.height
2。獲得窗口大小:
document.body.clientWidth
document.body.clientHeight
3。獲得窗口大小(包含Border、Scroll等元素)
document.body.offsetWidth
document.body.offsetHeight
div相關的一些元素詳細說明可以參考這張圖
screen.width
screen.height
2。獲得窗口大小:
document.body.clientWidth
document.body.clientHeight
3。獲得窗口大小(包含Border、Scroll等元素)
document.body.offsetWidth
document.body.offsetHeight
div相關的一些元素詳細說明可以參考這張圖
轉載于:https://www.cnblogs.com/Franking/articles/1343361.html
總結
以上是生活随笔為你收集整理的JS中获得窗口属性的方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2020年国家自然科学基金地球科学部会评
- 下一篇: Event 系列: jquery eve