jquery Gets the height

Source: Internet
Author: User

Divided into the following types:

. Height ()

-Gets the current calculated height value of the first element in the matching element collection or sets the height value of each matching element.

The difference between-.css (' height ') and. Height () is that the latter returns a numeric value with no units, which returns a string with a full unit. It is recommended to use the. Height () method when the height of an element requires mathematical calculations.

-This method can also calculate the height of window and document.

$ (window). Height ();
$ (document). Height ();

. Innerheight ()

-Gets the current calculated height value for the first element in the matching element collection, including padding, but does not include border.

-This method returns the height of the element, including the top and bottom padding, in pixels.

-this method does not apply to the window and document object and can be replaced with. Height ().

. Outerheight ()

-Gets the current calculated height value of the first element in the collection of elements, including padding,border and selective margin. Returns a value that is represented by an integer (not containing "px"), or null if the method is called on an empty collection.

-.outerheight ([Includemargin]): Include is a Boolean value that indicates whether the margin value of the element is included in the calculation.

-this method does not apply to window and document objects, and can be replaced with. Height ().

jquery Gets the height

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.