JS get various wide and high values in the browser

Source: Internet
Author: User

Width

ClientWidth: The width of the object's actual content, without edges, up to and including the viewport width
Offsetwidth: The actual width of the object, including edges, maximum no more than the viewport width
ScrollWidth: Object actual width, without edges, can exceed viewport width

Height: (both can exceed the viewport height)

ClientHeight: The height of the object's actual content, with no edges
Offsetheight: Object actual height, including edges
ScrollHeight: The object's actual height, not including edges. If the object is body, the actual height is greater than the viewport, and the viewport height is less than the viewport

Resolution width High:

Window.screen.width: Screen resolution width
Window.screen.height: Screen resolution height
Window.screen.availWidth: Screen width of the work area
Window.screen.availHeight: Screen Workspace height (does not contain Windows Sidebar)

Scrolling Distance:

ScrollTop: The height of the object being rolled away
ScrollLeft: The width of the object being rolled away

Offset value:

EVENT.CLIENTX: Horizontal offset value relative to document
Event.clienty: Vertical offset value relative to document
EVENT.OFFSETX: The horizontal offset value relative to the current object
Event.offsety: The vertical offset value relative to the current object
Offsetleft: Lateral offset value relative to parent element
OFFSETTOP: The vertical offset value of the relative parent element
Window.screentop: The horizontal offset value of the browser relative to the upper-left corner of the screen
Window.screenleft: The vertical offset value of the browser relative to the upper-left corner of the screen

JS get various wide and high values in the browser

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.