- window.screen.width、window.screen.height 屏幕宽度和高度。
- window.screen.availWidth、window.screen.availHeight 可用的屏幕高度和宽度,属性返回访问者屏幕的高度,以像素计,减去界面特性,比如窗口任务栏。
- window.screen.availLeft、window.screen.availTop 浏览器距屏幕左侧和上部的距离。
- window.outerWidth、window.outerHeight 浏览器高度和宽度。(页面可用高度和宽度加上工具栏)
- window.innerWidth、window.innerHeight 页面可用宽度和高度。
- scrollHeight和scrollWidth垂直滚动条高度和水平滚动条宽度。
- window.document.body.clientWidth、window.document.body.clientHeight 包括padding但不包括border、水平滚动条、margin的元素的高度。对于inline的元素这个属性一直是0,单位px,只读元素。
window.document.body.clientLeft、window.document.body.clientTop - window.document.body.offsetWidth、window.document.body.offsetHeight 包括padding、border、水平滚动条,但不包括margin的元素的高度。对于inline的元素这个属性一直是0,单位px,只读元素。
- window.document.body.offsetLeft 、window.document.body.offsetTop 相对于父元素。
屏幕和标签宽度和高度属性
最新推荐文章于 2025-05-09 18:24:41 发布