clientHeight ,offsetHeight,style.height,scrollHeight有区别与联系
时间:2011-02-28 来源:aparche
同理: clientWidth,offsetWidthstyle.width,scrollWidth
演示时营造不同的环境测试(改变eyejs元素的样式)
<div id="eyejs" style="border: solid 10px red;width:100px;overflow:scroll;">
<div style=""></div>
</div>
<input type="button" onclick="alert(document.getElementById('eyejs').clientHeight)" value="点击clientHeight" />
<input type="button" onclick="alert(document.getElementById('eyejs').style.height)" value="点击style.height" />
<input type="button" onclick="alert(document.getElementById('eyejs').offsetHeight)" value="点击offsetHeight" />
<input type="button" onclick="alert(document.getElementById('eyejs').scrollHeight)" value="点击scrollHeight" />
相关阅读 更多 +