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/
相关推荐
<p>JQ高仿select控件 <br/> <div style="height:100px;border-bottom:5px solid #ff0000;"> 张三 李四 王二麻子 ...
NULL 博文链接:https://onestopweb.iteye.com/blog/2359446
height: 300px;width: 930px;margin: 0 auto;} #slideshow a{float: left;display: inline;} #slideshow .img{position: absolute;width: 930px;height: 300px;overflow: hidden} #slideshow .img span{position: ...
jQuery自动适应高度布局代码是一款设置height页面自动适应高度布局效果代码。
-- 模板对象添加打印面板 paperHeader:页眉线 paperFooter:页尾线-->var panel = hiprintTemplate.addPrintPanel({ width: 100, height: 130, paperFooter: 340, paperHeader: 10 }); <!-- 文本 打印面板添加...
主要介绍了jQuery使用height()获取高度需要注意的地方,对于display:none或者隐藏的部分无法获取到其高度,这是使用jQuery的height方法需要注意的地方,需要的朋友可以参考下
image_height = $("#rImg").height(), ration_r = image_width/image_height; $("#selectArea").css({ background:"#888888", width:canvans_width, height:canvans_height }); var paper = Raphael("selectArea",...
这是一个 JavaScript(带有 jQuery)文件,它使用 div 的背景图像来创建动画和可选的翻转效果。 要求 spriteControl.js 中的函数使用 jQuery。 使用这些功能 将 spriteControl.js 添加到网页。 将 ...
line-height: 24.0px; font: 12.0px 'Heiti SC Light'; color: #323333} span.s1 {font-kerning: none} 效果描述: 一组新老结合的代码实现的动画效果 为什么说是新老结合呢,首先,页面是基于jQuery实现的...
上次我们介绍过一款基于HTML5的图片马赛克效果,今天我们要来介绍一款基于... height = data.naturalHeight, rotate = data.rotate, rotated = getRotatedSizes({ width: width, height:[......] 阅读全文>>
height: 100%; width: 100%; overflow: hidden; } .lock { z-index: 10; position: absolute; width: 100%; height: 100%; background: url(images/lock.jpg) no-repeat center; ...
jq ? 对于已经使用javascript的人来说,javascript显然是更好的选择。特征使用ramda.js(1.3版或更高版本)进行数据处理您可以使用 例如。 http https://swapi.co/api/people/1/ | j -r "props(['name', 'height']...
博主也是在学js,老师出了这么一道题,博主... height: 50px; background-color: yellow; position: absolute; left:10px; top:50px; } 移动 var wid=0; var hei=0; var offset=$('#ff').offset(); var widd=
先引入jq代码,然后代码如下: $(function(){ var docHeight = $(document).height(); //获取窗口高度 $('body').append('<div id=overlay></div>'); $('#overlay') .height(docHeight) .css({ 'opacity': .9...
.height()); //浏览器当前窗口可视区域高度 alert($(document).height()); //浏览器当前窗口文档的高度 alert($(document.body).height());//浏览器当前窗口文档body的高度 alert($(document....
一款非常简单的jQuery纵向时间轴代码,无论li内容多少,直线都不会超出,并且红点永远居中的jQuery垂直时间轴插件。 js代码 ...$(".line").height($(".about4_main").height()-h1-h); }); [removed]
line-height:117px;} #box{ width:0; overflow:hidden; float:left;} .btn1{ display:block; border:none; cursor:pointer; float:left; background:url(../images/slide-button-active.gif) no-repeat; width:43px...
JQ-动画-节点-事件-委托一、 jquery动画二、尺寸相关、滚动事件三、jquery属性操作四、jquery循环五、jquery事件六、事件冒泡七、事件委托八、jquery元素节点操作 一、 jquery动画 通过animate方法可以设置元素某...
就默默的找了京东、亚马逊、淘宝、当当等他们关于省市区是怎么做的。图如下: 最后我结合一下做了如下图: 废话不多说上源码: <style type="text/css"> #divProCity { position:absolute; width:350...
* {line-height: 150%} .image {text-align: center; line-height: 590px; margin: 30px auto 0px; width: 850px; height: 620px} .image img { overflow:hidden} img {border:0px} #photo_content {text-align: ...