您的位置:首页 > 其它

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/

阅读更多
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: