The differences between the jQuery height (), innerheight (), and outerheight () functions are detailed

Source: Internet
Author: User

The differences between the jQuery height (), innerheight (), and outerheight () functions are detailed

In jquery, there are 3 functions that get the height of an element, which are height (), innerheight (), and Outerheight ().

Corresponding to this, there are 3 functions that get the width of the element, which are width (), innerwidth (), Outerwidth (), respectively.

Here, we take height() , innerHeight() and outerHeight() 3 functions as examples, to detail the differences between them.

Let's take the example of the box model of element elements to describe the difference between them.

function height range jquer Y version supports write operations
height () height 1.0+
1.0+
innerheight () height + padding 1.2.6+ 1.8.0+
outerheight () height + padding + border 1.2.6+ no
outerheight (True) height+padding+border+margin 1.2.6+ no
1. Only height() functions can be used window or document objects.
2, "Support write operation" means that the function can set the height value for the element.
3, 1.4.1+ height() new support parameters are functions (previously only supported values).
4, 1.8.0+ innerHeight() support parameters are numeric or function.

The differences between the jQuery height (), innerheight (), and outerheight () functions are detailed

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.