Home  >  Article  >  Web Front-end  >  Example of usage of outerHeight() method in jQuery_jquery

Example of usage of outerHeight() method in jQuery_jquery

WBOY
WBOYOriginal
2016-05-16 16:19:341148browse

The example in this article describes the usage of the outerHeight() method in jQuery. Share it with everyone for your reference. The specific analysis is as follows:

This method gets the outer height of the first matching element.
By default the outer height is the sum of height, padding and border.
If the parameter is set to true, the outer margin size will also be included in the outer width.
This method works for both visible and hidden elements.
Can be combined with outerWidth() method to learn.

Grammar structure:

Copy code The code is as follows:
$(selector).outerHeight(options)

Parameter list:

参数 描述
options 定义是否把外补白(margin)计算在内:
一.fase,边距不计算在内,默认值。
二.true,边距计算在内。

实例代码:

复制代码 代码如下:






outerHeight()函数-脚本之家





 
此处显outerHeight数值

 


点击按钮可以显示div元素外部高度。

希望本文所述对大家的jQuery程序设计有所帮助。

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