Jquery 的outerHeight方法使用介绍

2019-12-24,,

获取第一个匹配元素外部高度(默认包括补白和边框)。

此方法对可见和隐藏元素均有效。

outerHeight(options)

optionsBoolean默认值:'false'

设置为 true 时,计算边距在内。

描述:
获取第一段落外部高度。

HTML 代码:
复制代码 代码如下:
<p>Hello</p><p>2nd Paragraph</p>

jQuery 代码:
复制代码 代码如下:
var p = $("p:first");
$("p:last").text( "outerHeight:" + p.outerHeight() + " , outerHeight(true):" + p.outerHeight(true) );

结果:
复制代码 代码如下:
<p>Hello</p><p>outerHeight: 35 , outerHeight(true):55</p>

您可能感兴趣的文章:

  • jQuery中outerHeight()方法用法实例
  • jQuery中的height innerHeight outerHeight区别示例介绍
  • jQuery帮助之CSS尺寸(五)outerHeight、outerWidth
  • jQuery中outerWidth()方法用法实例
  • jQuery获得document和window对象宽度和高度的方法
  • jQuery设置指定网页元素宽度和高度的方法
  • Jquery实现鼠标移动放大图片功能实例
  • jQuery获得包含margin的outerWidth和outerHeight的方法

《Jquery 的outerHeight方法使用介绍.doc》

下载本文的Word格式文档,以方便收藏与打印。