jQuery innerHeight() 方法

jQuery 教程 · 2019-03-27 14:13:47

实例

返回 <div> 元素的内部高度:

$("button").click(function(){ alert($("div").innerHeight()); });

定义和用法

innerHeight() 方法返回第一个匹配元素的内部高度。

如下面的图像所示,该方法包含 padding,但不包含 border 和 margin。

jQuery Dimensions

相关方法:

  • width() - 设置或返回元素的宽度
  • height() - 设置或返回元素的高度
  • innerWidth() - 返回元素的宽度(包含 padding)
  • outerWidth() - 返回元素的宽度(包含 padding 和 border)
  • outerHeight() - 返回元素的高度(包含 padding 和 border)

语法

$(selector).innerHeight()

点击查看所有 jQuery 教程 文章: https://codercto.com/courses/l/35.html

查看所有标签

Programming From The Ground Up

Programming From The Ground Up

Jonathan Bartlett / Bartlett Publishing / 2004-07-31 / USD 34.95

Programming from the Ground Up is an introduction to programming using assembly language on the Linux platform for x86 machines. It is a great book for novices who are just learning to program as wel......一起来看看 《Programming From The Ground Up》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

在线进制转换器
在线进制转换器

各进制数互转换器

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器