jq 关于height
2015-11-18 15:37
176 查看
height:高度
innerHeight:高度+补白
outerHeight:高度+补白+边框,参数为true时:高度+补白+边框+边距
html代码:
<div class="width: 150px;height:20px;float: left;border: 2px solid red;margin: 10px;margin: 10px;padding: 10px;" id="test">jjjjj</div>
js代码:
alert($("#test").height());
alert($("#test").innerHeight());
alert($("#test").outerHeight());
alert($("#test").outerHeight(true));
结果:
在ie中的结果:17px,37px,41px,61px
在ff中的结果:20px,40px,44px,64px
推荐参考地址:http://www.css88.com/jqapi-1.9/height/
阅读更多相关文章推荐
- 关于用Jquery的height()、width()计算动态插入的IMG标签的宽高的问题
- 关于height:100%失效的解决
- Unity学习笔记(5) --- Unity的界面排版:AutoLayout详解——关于高度height的计算
- 关于html中的height、innerHeight、outerHeight区别
- 关于clientWidth、offsetWidth、clientHeight、offsetHeigh
- 关于jq操作table下多个type=radio的input的选中
- js、JQ中获取各种Width、Height方法
- 【笔记】关于jq $.ajax 函数 success回调函数不能赋正确值或返回正确值的问题
- 关于前端的各种height问题
- 关于line-height导致的布局出错
- 关于css3+jq的不出现滚动条的下拉菜单
- 关于jq动态创建出按钮不能添加事件解决办法
- 关于JQ checkbox选择的问题
- 关于css中 line-height 在ie中和在chrome中错位的问题
- 关于JQ JS的延时方法笔记
- 关于firefox的高度 html,body{ height:100%;}
- 关于clientWidth、offsetWidth、clientHeight、offsetHeight比较
- 关于getMeasureHeight和自定义view
- jQ的.height()方法/按百分比设置block元素垂直居中/设置logo背景色
- 关于JQ中的trigger和triggerHandler