Home  >  Article  >  Web Front-end  >  Introduction to the use of Jquery's outerHeight method_jquery

Introduction to the use of Jquery's outerHeight method_jquery

WBOY
WBOYOriginal
2016-05-16 17:22:521058browse

Gets the outer height of the first matching element (default includes padding and border).

This method works for both visible and hidden elements.

outerHeight(options)

optionsBoolean default value: 'false'

When set to true, the margins are included.

Description:
Get the outer height of the first paragraph.

HTML code:

Copy code The code is as follows:

Hello

2nd Paragraph



jQuery code:
Copy code The code is as follows:

var p = $("p:first");
$("p:last" ).text( "outerHeight:" p.outerHeight() " , outerHeight(true):" p.outerHeight(true) );

Result:
Copy code The code is as follows:

Hello

outerHeight: 35 , outerHeight(true):55


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn