怎样获取元素的高度

<div id="d">

  <div style="heigth:30px"></div>

</div>

 

document.getElementById("id").style.height----------->是获取不到他的高度的。

document.getElementById("id").clientHeight------------>获取他的高度

clientHeight
大家对 clientHeight 都没有什么异议,都认为是内容可视区域的高度,也就是说页面浏览器中可以看到内容的这个区域的高度,一般是最后一个工具条以下到状态栏以上的这个区域,与页面内容无关。

 

http://www.chinahtml.com/0707/118517329315161.html

 

scrollHeight与clientHeight的区别:

 

 

http://book.douban.com/people/tiemuxu/annotation/3007076/

 

 

http://qqshumubao.blog.163.com/blog/static/473930172010112735029861/

 

 

 

scrollHeight和clientHeight的区别 - 飞来的燕子 - 飞来的燕子的博客

posted @ 2014-04-13 01:25  daishuguang  阅读(618)  评论(0编辑  收藏  举报