Home  >  Article  >  Web Front-end  >  Summary of several attributes that DOM2 is non-standard but supports very well_DOM

Summary of several attributes that DOM2 is non-standard but supports very well_DOM

WBOY
WBOYOriginal
2016-05-16 17:56:531058browse
1. Offset


offsetWidth: refers to the space occupied by the element in the horizontal direction, including the width of the border and scroll bar
offsetHeight: refers to the vertical direction of the element The amount of space occupied by the element, including the height of the border and scroll bar
offsetLeft: Returns the left offset of the element, that is, the pixel distance from the left outer border of the element to the left inner border of the containing element
offsetTop: Returns the element's left offset Top offset, that is, the pixel distance from the top outer border of the element to the top inner border of the containing element
offsetParent: Returns the index of the nearest dynamically positioned containing element, that is, the ancestor element of the element


2. Client area size

clientWidth: refers to the space occupied by the element content (including padding) in the horizontal direction, excluding the width of the border and scroll bar
clientHeight : Refers to the space occupied by the element content (including padding) in the vertical direction, excluding the height of the border and scroll bar


3. Scroll size

scrollWidth: refers to the actual width of the element content (including padding), including the hidden content width
scrollHeight: refers to the actual height of the element content (including padding), including the hidden content height
scrollLeft: refers to the width of the hidden content on the left side of the element
scrollTop: refers to the height of the hidden content above the element
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn