JS get object width and height

Source: Internet
Author: User
JavaScript to get the object width and height

Obtain the wide and high values of tag Elements
// Absolute width
OBJ. offsetwidth
// Absolute height
OBJ. offsetheight

The following describes how to obtain the high value of window objects.
Clientheight obtains the height of an object. It does not calculate any margin, border, or scroll bar, but includes the padding of the object.
Clientleft gets the distance between the offsetleft attribute and the actual left side of the customer region.
Clienttop obtains the distance between the offsettop attribute and the actual top of the customer region.
Clientwidth is used to obtain the width of an object. It does not calculate any margin, border, or scroll bar, but includes the padding of the object.
Clientx sets or obtains the X coordinates of the mouse pointer position relative to the client area of the window. The client area does not include the control and scroll bar of the window.
Clienty sets or obtains the Y coordinate of the mouse pointer position relative to the client area of the window. The client area does not include the control and scroll bar of the window.
Clip sets or obtains which part of the target object is visible.
Clipbottom obtains the coordinate of the bottom edge of the cropping area.
Clipleft obtains the left coordinate of the Cropping Area of an object.
Clipright is used to obtain the right coordinate of the Cropping Area of an object.
Cliptop obtains the coordinate of the top edge of the cropping area.

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.