继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

jQuery之height()、innerHeight()、outerHeight()函数

BIG阳
关注TA
已关注
手记 308
粉丝 68
获赞 456

在jQuery中,获取元素高度的函数有3个,它们分别是height()、innerHeight()、outerHeight()
与此相对应的是,获取元素宽度的函数也有3个,它们分别是width()、innerWidth()、outerWidth()

下面我以height()、innerHeight()、outerHeight()三个函数为例,以元素element的盒模型为例来介绍它们之间的区别。

Paste_Image.png

函数高度范围
height()content
innerHeight()content+padding
outerHeight()content+padding+border
outerHeight(true)content+padding+border+margin
只有height()函数可用于window或document对象。



作者:匿名用户404
链接:https://www.jianshu.com/p/fc5a4a3bccba

打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP