Measure Element Height In jQuery

There is are three methods in JQuery that deals with the height of a element.

.height() : 

$.height() :   it measure the height of the element/container excluding applied padding, margin and border-width.
jQuery.height()

it measure the height of the element/container excluding applied padding, margin and border-width.

.innerHeight() :

it measure the height of the element/container excluding applied margin. It includes applied padding but not border-width of the element.

jQuery.innerHeight() :  it measure the height of the element/container excluding applied margin. It includes applied padding but not border-width of the element.
$.innerHeight() In jQuery

.outerHeight() :

It measures the height of the element/container including all applied padding + border width but not margin. If you want to include margin too, you should use .outerHeight(true)

.outerHeight() :  It measures the height of the element/container including all applied padding + border width but not margin. If you want to include margin too, you should use .outerHeight(true)
$.outerHeight() In jQuery

Any of the method will provide ‘pixel’ value of the height of container. We just have to select the method which that suits our requirement. first of all apply style=”height:auto;” in element, so it can get the height as per content in it.

Cheers !!

Advertisements

Say something : I accept all the "Humer&Critic"

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s