top、postop、scrolltop、offsetTop、scrollHeight、offsetHeight、clientHeight
来源:互联网 发布:2016网络流行词语大全 编辑:程序博客网 时间:2024/05/01 22:53
posTop的数值其实和top是一样的,但区别在于,top固定了元素单位为px,而posTop只是一个数值,一般使用posTop来进行运算。
scrollHeight: 获取对象的滚动高度。
scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离
scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
scrollWidth:获取对象的滚动宽度
offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度
offsetLeft:获取对象相对于版面或由 offsetParent 属性指定的父坐标的计算左侧位置
offsetTop:获取对象相对于版面或由 offsetTop 属性指定的父坐标的计算顶端位置
event.clientX 相对文档的水平座标
event.clientY 相对文档的垂直座标
event.offsetX 相对容器的水平坐标
event.offsetY 相对容器的垂直坐标
这里是javascript中建造迁移转变代码的常用属性
页可见区域宽: document.body.clientWidth;
网页可见区域高: document.body.clientHeight;
网页可见区域宽: 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;
假设 obj 为某个 HTML 控件。
obj.offsetTop 指 obj 相对于版面或由 offsetParent 属性指定的父坐标的计算上侧位置,整型,单位像素。(相对于offsetParent 指定的父偏移对象的上边框的偏移距离)
obj.offsetLeft 指 obj 相对于版面或由 offsetParent 属性指定的父坐标的计算左侧位置,整型,单位像素。
obj.offsetWidth 指 obj 控件自身的绝对宽度,不包括因 overflow 而未显示的部分,也就是其实际占据的宽度,整型,单位像素。
obj.offsetHeight 指 obj 控件自身的绝对高度,不包括因 overflow 而未显示的部分,也就是其实际占据的高度,整型,单位像素。
我们对前面提到的 offsetParent 作个说明。
offsetParent 获取定义对象 offsetTop 和 offsetLeft 属性的容器对象的引用。offsetTop 与 offsetParent 很复杂,不同浏览器有不同解释,浮动一下解释又不同了,所以我们一般只要理解通过二者可以获得控件在浏览器中的绝对位置即可。
clientHeight
大家对 clientHeight 都没有什么异议,都认为是内容可视区域的高度,也就是说页面浏览器中可以看到内容的这个区域的高度,一般是最后一个工具条以下到状态栏以上的这个区域,与页面内容无关。
1. jQuery中的offset()和position()
offset():相对浏览器窗口
position():相对父元素
- top、postop、scrolltop、offsetTop、scrollHeight、offsetHeight、clientHeight
- top、postop、scrolltop、offsetTop、scrollHeight、offsetHeight、clientHeight
- 页面位置 top、postop、scrolltop、offsetTop、scrollHeight、offsetHeight、clientHeight
- top、postop、scrolltop、offsetTop、scrollHeight、offsetHeight、clientHeigh
- top、postop、scrolltop、scrollHeight、offsetHeight
- top、postop、scrolltop、scrollHeight、offsetHeight
- clientHeight/scrollHeight/offsetHeight/offsetParent/offsetTop/offsetHeight/scrollTop
- 搞清top、postop、scrolltop、scrollHeight、offsetHeight
- 搞清top、postop、scrolltop、scrollHeight、offsetHeight
- 搞清top、postop、scrolltop、scrollHeight、offsetHeight
- scrollWidth,offsetWidth,clientWidth,width;scrollHeight,offsetHeight,clientHeight,height;offsetTop,scrollTop,top;offsetLeft,scrol
- 花点时间搞清top、postop、scrolltop、scrollHeight、offsetHeight
- 花点时间搞清top、postop、scrolltop、scrollHeight、offsetHeight
- 搞清楚top、postop、scrolltop、scrollHeight、offsetHeight 的用法
- 花点时间搞清top、postop、scrolltop、scrollHeight、offsetHeight
- 终于清晰啦!offsetHeight、scrollHeight、clientHeight和offsetTop、scrollTop、clientTop
- offsetTop,offsetHeight,scrollHeight,scrollTop的区别
- clientTop、scrollTop、offsetTop、scrollHeight、clientHeight、offsetParent。。。
- spring mvc controller接收请求值及controller之间跳转及传值
- SpringMVC注入参数时为什么必须要在注解中写变量名
- jquery-1.10.2.min.map 404 (Not Found)问题及解决
- spring Mvc 教程框架实例以及系统演示下载
- 机器学习/统计学方法/算法 —— 总体架构目录
- top、postop、scrolltop、offsetTop、scrollHeight、offsetHeight、clientHeight
- js中金融数字格式 js中字符串反转
- VMware Workstation 共享磁盘和Linux的UDEV使用
- Divide Two Integers
- struts2的OGNL表达式(三)
- Xcode模拟器The operation couldn’t be completed. (LaunchServicesError error 0.)
- 开源中国源码学习UI篇(二)之NavigationDrawer+Fragment的使用分析
- 带有地图的Activity在截屏时地图空白,原来必须使用地图自带的截屏。
- 值得关注的10个C语言开源项目