jQuery中的.height()、.innerHeight()和.outerHeight()
来源:互联网 发布:淘宝网店如何注册 编辑:程序博客网 时间:2024/05/21 08:58
在jQuery中,width()方法用于获得元素宽度;innerWidth()方法用于获得包括内边界(padding)的元素宽度,outerWidth()方法用于获得包括内边界(padding)和边框(border)的元素宽度,如果outerWidth()方法的参数为true则外边界(margin)也会被包括进..
jQuery中的.height()、.innerHeight()和.outerHeight()和W3C的盒模型相关的几个获取元素尺寸的方法。对应的宽度获取方法分别为.width()、.innerWidth()和.outerWidth()
1. .height()
获取匹配元素集合中的第一个元素的当前计算高度值 或 设置每一个匹配元素的高度值(带一个参数)。注意:1).css('height')和.height()之间的区别是后者返回一个没有单位的数值(例如,400),前者是返回带有完整单位的字符串(例如,400px)。
2).height()总是返回内容宽度,不管CSSbox-sizing属性值。.height('value')设置的容器宽度是根据CSSbox-sizing属性来定的, 将这个属性值改成border-box,将造成这个函数改变这个容器的outerHeight,而不是原来的内容高度。
2. .innerHeight()
为匹配的元素集合中获取第一个元素的当前计算高度值,包括padding,但是不包括border。3. .outerHeight()
获取元素集合中第一个元素的当前计算高度值,包括padding,border和选择性的margin。返回一个整数(不包含“px”)表示的值 ,或如果在一个空集合上调用该方法,则会返回 null。在.outerHeight()计算中总是包含padding-top ,padding-bottom 和 border-top,border-bottom ;如果includeMargin参数是true,那么margin (top 和 bottom)也会被包含。
1 0
- jQuery中的.height()、.innerHeight()和.outerHeight()
- jQuery中的.height()、.innerHeight()和.outerHeight()
- jQuery中的height(),innerHeight()和outerHeight()
- jQuery中的.height()、.innerHeight()和.outerHeight()的区别
- jquery height() innerHeight () outerHeight( )
- jQuery中的 height innerHeight outerHeight区别
- jquery的height(),innerHeight(),outerHeight()
- 比较height(),innerHeight(),outerHeight()和outerHeight(true)
- jQuery中的height()、innerheight()、outerheight()的区别总结
- Jquery(JS)中.height()和.innerHeight(),outerHeight()的差别
- jQuery中height、innerheight和outerheight的区别
- jquery innerHeight(),outerHeight(),height()的区别
- jquery innerheight/innerwidth,width/height,outerwidth/outerheight
- jQuery height()、innerHeight()、outerHeight()函数的区别
- 关于html中的height、innerHeight、outerHeight区别
- height/innerHeight/outerHeight
- jQuery height()、innerHeight()、outerHeight()函数的区别详解
- jQuery中height()、innerheight()、outerheight()有什么不同
- Spring MVC过滤器-字符集过滤器(CharacterEncodingFilter)中文乱码问题
- D方法与M方法
- c++幻方的解法与判断
- cuda 数组注意事项
- Canvas操作以及图层
- jQuery中的.height()、.innerHeight()和.outerHeight()
- Struts2环境搭建
- eclipse自动补全的设置
- [css] css3
- 框架(一)struts2——初识
- 3d材质参数
- HTTP状态码->HTTP Status Code
- 【北京】9月24日 NodeJS 区块链茶座·第一期:为什么一定要玩区块链?
- 抓包工具charles的破解方法