JS's Offsetwidth\offsetleft

Source: Internet
Author: User

Web page Visible area width: document.body.clientWidth;
Web page Visible Area High: document.body.clientHeight;
Web page Visible Area width: document.body.offsetWidth (including the width of the edge);
Web page Visible Area High: document.body.offsetHeight (including the width of the edge);
Page body Full text width: document.body.scrollWidth;
Page body Full text High: document.body.scrollHeight;
The page was rolled High: document.body.scrollTop;
The webpage is rolled away left: document.body.scrollLeft;
Page body part: window.screentop;
Page body part left: window.screenleft;
High screen resolution: window.screen.height;
Width of screen resolution: Window.screen.width;
Screen available working area height: window.screen.availHeight;
Screen available working area width: window.screen.availWidth;

ClientHeight: The height of the content viewable area, that is, the page browser can see the content of this area of the height, usually the last toolbar below the status bar above the area, regardless of the content of the page.

ScrollHeight: Gets the scroll height of the object.
ScrollLeft: Sets or gets the distance between the left edge of the object and the leftmost of the currently visible content in the window
ScrollTop: Sets or gets the distance between the top of the object and the top of the visible content in the window
ScrollWidth: Gets the scrolling width of the object
Offsetheight: Gets the height of the object relative to the layout or parent coordinates specified by the parent coordinate OffsetParent property
Offsetleft: Gets the calculated left position of the object relative to the layout or the parent coordinate specified by the OffsetParent property
OffsetTop: Gets the computed top position of the object relative to the layout or the parent coordinate specified by the OffsetTop property

Event.clientx horizontal coordinates of relative documents
Event.clienty vertical coordinates of relative documents
Event.offsetx horizontal coordinates relative to the container
Event.offsety the vertical coordinate of the relative container
Document.documentElement.scrollTop The vertical scrolling value
Event.clientx+document.documentelement.scrolltop horizontal coordinates of relative documents + amount of vertical scrolling

The above mainly refers to IE, Firefox differences are as follows:
IE6.0, ff1.06+:
clientwidth = width + padding
clientheight = height + padding
offsetwidth = width + padding + border
offsetheight = height + padding + border
ie5.0/5.5:
ClientWidth = Width-border
ClientHeight = Height-border
offsetwidth = width
offsetheight = height



1.clientHeight, ClientWidth:
These two properties generally show the pixel height and width of the element's content. Theoretically, these measurements are not considered for any addition of the style sheet
The page margins, borders, and so on in the element.

2.clientleft,clienttop:
These two return the thickness of the border around the element, and if you do not specify a border or do not position the element, his value is 0.

3.scrollleft,scrolltop:
If the elements can be scrolled, you can get how far the elements are scrolled in both horizontal and vertical directions, in pixels, by these two properties.
For elements that cannot be scrolled, these values are always 0.

4.scrollheight,scrollwidth:
No matter how many objects are visible on the page, they get the whole.

5.style.left:
Offset of the left edge of the rectangle containing the anchor element

6.style.pixelleft:
Returns the integer pixel value of the left boundary offset of the anchored element. Because the non-pixel value of the property returns a string containing the unit, for example, 30px. This property allows you to handle numeric values in pixels individually.

7.STYLE:POSLETF:
Returns the value of the number of the left boundary offset of the anchored element, regardless of the unit specified by the corresponding style sheet element. Because the non-positional value of the property returns a string containing the unit, for example, 1.2EM

Top,pixeltop,postop a few analogies on the line.
Left: The distance between the left and right edge of the screen.
ClientLeft returns the distance between the Offsetleft property value of the object and the true value to the left of the current window
Offsetleft returns the left value of the layout or coordinates of the object relative to the parent object, which is the x-coordinate of the X-, y-axis positive direction of the parent object, the upper-right corner of the parents as the coordinate origin.
Pixelleft Sets or returns the position of the object relative to the left side of the window
ScrollWidth is the width of the actual content of the object, without the width of the edge, which changes depending on how much content is in the object (the actual width of the object may be changed by more content).
ClientWidth is the width of the object visible, without edges such as the scroll bar, which changes with the window's display size.
The offsetwidth is the visible width of the object, and the edges such as the package scroll bar change with the window's display size.

JS's Offsetwidth\offsetleft

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.