JS浏览器获取宽高
2016-01-30 09:22
603 查看
screen.availHeightis
the height the browser's window can have if it is maximized. (including all the window decoration of the browser like the status bar, menu bars and title bar)
$(window).height()is
the height of the viewport that shows the website. (excluding your toolbars and status bar and stuff like this)
$(document).height()is
the height of your document shown in the viewport. If it is higher than
$(window).height()you
get the scrollbars to scroll the document.
网页可见区域宽:document.body.clientWidth
网页可见区域高:document.body.clientHeight (html下获取浏览器高度,xhtml下获取元素总高度)
网页可见区域高:document.documentElement.clientHeight (xhtml下获取浏览器高度)
网页可见区域宽:document.body.offsetWidth (包括边线的宽)
网页可见区域高:document.body.offsetHeight (包括边线的宽)
网页正文全文宽:document.body.scrollWidth
网页正文全文高:document.body.scrollHeight
网页被卷去的高:document.body.scrollTop
网页被卷去的左:document.body.scrollLeft
网页正文部分上:window.screenTop
网页正文部分左:window.screenLeft
屏幕分辨率的高:window.screen.height
屏幕分辨率的宽:window.screen.width
屏幕可用工作区高度:window.screen.availHeight
屏幕可用工作区宽度:window.screen.availWidth
相关文章推荐
- JS输入银行卡号,4位自动加空格
- js为什么用工厂模式 Class.create
- Mod31算法的javascript实现
- ajax.js
- JavaScript的第一次小结
- 深入分析Javascript事件代理
- 实现高性能JavaScript之执行与加载
- JavaScript中的this机制
- JS排序方法(sort,bubble,select,insert)代码汇总
- JavaScript基础—插曲02
- JavaScript基础—插曲
- JavaScript基础—dom,事件
- JavaScript基础—闭包,事件
- JS的跳转
- JavaScript基础插曲—获取标签,插入元素,操作样式
- JavaScript
- js中的prototype和__proto__
- 旧知识的巩固,js多维数组的for定义,js自定义键值数组的定义
- 加入JavaScript 定时器开发俄罗斯方块模式的2048项目
- 双色球、大乐透、3D精选版!祝君好运(Javascript)