css-offsetParent翻译
2015-07-02 14:34
706 查看
对offsetParent的翻译
来源:http://www.w3.org/TR/cssom-view/#dom-htmlelement-offsetparent
offsetParent的属性返回值计算遵循以下步骤:
1、 If any of the following holds true return null and terminate this algorithm:
如果该元素满足以下任意一个,则element.offSetParent 返回null,终止该算法
The element does not have an associated CSS layout box.
该元素没有相关的CSS布局box
The element is the root element.
该元素是根元素(html)
The element is the HTML body element.
该元素是HTML body元素
The element's computed value of the 'position' property is 'fixed'.
该元素的position为"fixed"
2、Return the nearest ancestor element of the element for which at least one of the following is true and terminate this algorithm if such an ancestor is found:
返回最近的一个祖先元素。祖先元素满足以下条件的至少一条,同时如果找到这样的元素,终止该算法。
The computed value of the 'position' property is not 'static'.
该元素position的值不是"static"
It is the HTML body element.
该元素是body元素
The computed value of the 'position' property of the element is 'static' and the ancestor is one of the following HTML elements: td, th, or table.
该元素的position属性所得值为static,同时这个元素是以下元素之一:td,th,table
3、Return null.
返回null
The offsetTop attribute must return the result of running these steps:
1、If the element is the HTML body element or does not have any associated CSS layout box return zero and terminate this algorithm.
如果该元素是html的body元素,或者没有相关的CSS layout box,则返回zero,终止该算法
2、If the offsetParent of the element is null return the y-coordinate of the top border edge of the first CSS layout box associated with the element, relative to the initial containing block origin, ignoring any transforms that apply to the element and its ancestors, and terminate this algorithm.
如果该元素的offsetParent是null,返回该元素的的top border edge到相关的css 布局盒子的y坐标。与最初包含原始block相关,忽略任何应用到其元素上面的transforms和他的祖先。终止该算法。
Return the result of subtracting the y-coordinate of the top padding edge of the first CSS layout box associated with the offsetParent of the element from the y-coordinate of the top border edge of the first CSS layout box associated with the element, relative to the initial containing block origin, ignoring any transforms that apply to the element and its ancestors.
返回offsetParent元素相关联的第一个css布局盒子top padding edge的y坐标,减去该元素相关联的第一个css布局盒子的top border edge 的y坐标。与最初包含原始block相关,忽略任何应用到其元素上面的transforms和他的祖先。终止该算法。
An inline element that consists of multiple line boxes will only have its first CSS layout box considered.
一个由多个内联盒子组成的内联元素将只会考虑它的第一个css 布局盒子
The offsetLeft attribute must return the result of running these steps:
*****
未完待续
来源:http://www.w3.org/TR/cssom-view/#dom-htmlelement-offsetparent
offsetParent的属性返回值计算遵循以下步骤:
1、 If any of the following holds true return null and terminate this algorithm:
如果该元素满足以下任意一个,则element.offSetParent 返回null,终止该算法
The element does not have an associated CSS layout box.
该元素没有相关的CSS布局box
The element is the root element.
该元素是根元素(html)
The element is the HTML body element.
该元素是HTML body元素
The element's computed value of the 'position' property is 'fixed'.
该元素的position为"fixed"
2、Return the nearest ancestor element of the element for which at least one of the following is true and terminate this algorithm if such an ancestor is found:
返回最近的一个祖先元素。祖先元素满足以下条件的至少一条,同时如果找到这样的元素,终止该算法。
The computed value of the 'position' property is not 'static'.
该元素position的值不是"static"
It is the HTML body element.
该元素是body元素
The computed value of the 'position' property of the element is 'static' and the ancestor is one of the following HTML elements: td, th, or table.
该元素的position属性所得值为static,同时这个元素是以下元素之一:td,th,table
3、Return null.
返回null
The offsetTop attribute must return the result of running these steps:
1、If the element is the HTML body element or does not have any associated CSS layout box return zero and terminate this algorithm.
如果该元素是html的body元素,或者没有相关的CSS layout box,则返回zero,终止该算法
2、If the offsetParent of the element is null return the y-coordinate of the top border edge of the first CSS layout box associated with the element, relative to the initial containing block origin, ignoring any transforms that apply to the element and its ancestors, and terminate this algorithm.
如果该元素的offsetParent是null,返回该元素的的top border edge到相关的css 布局盒子的y坐标。与最初包含原始block相关,忽略任何应用到其元素上面的transforms和他的祖先。终止该算法。
Return the result of subtracting the y-coordinate of the top padding edge of the first CSS layout box associated with the offsetParent of the element from the y-coordinate of the top border edge of the first CSS layout box associated with the element, relative to the initial containing block origin, ignoring any transforms that apply to the element and its ancestors.
返回offsetParent元素相关联的第一个css布局盒子top padding edge的y坐标,减去该元素相关联的第一个css布局盒子的top border edge 的y坐标。与最初包含原始block相关,忽略任何应用到其元素上面的transforms和他的祖先。终止该算法。
An inline element that consists of multiple line boxes will only have its first CSS layout box considered.
一个由多个内联盒子组成的内联元素将只会考虑它的第一个css 布局盒子
The offsetLeft attribute must return the result of running these steps:
*****
未完待续
相关文章推荐
- CSS控制之IE常见BUG及解决方案
- 测试看看博客样式
- CSS滤镜让图片模糊(毛玻璃效果)实例页面
- CSS滤镜让图片模糊(毛玻璃效果)实例页面
- HTML+CSS学习笔记
- css position属性 以及 float、display、position的问题整合
- CSS 鼠标样式大全
- 36种漂亮的CSS3网页按钮Button样式,总有你喜欢的
- checkbox复选框样式
- CSS3实现整屏切换效果
- css 雪碧图sprite的使用
- CSS里的各种水平垂直居中基础写法心得
- css中水平垂直居中对齐布局一些实例总结
- 为什么要初始化css样式。
- CSS3 立方体
- System.Web.Optimization对脚本和样式表的操作
- 网页头部声明lang=”zh-cn”、lang=“zh”、lang=“zh-cmn-Hans”区别
- css兼容tooltip提示框方法
- CSS3魔法堂:CSS3滤镜及Canvas、SVG和IE滤镜替代方案详解
- 引用css和js链接地址中带的问号是什么意思?