offsetHeight:包括内容、内边距、边框的高度
clientHeight:包括内容、内边距的高度
看一下下边的css定义后的效果
.game-opt {
margin-top: 10px;
margin-bottom: 10px;
padding-top: 3px;
height: 20px;
border: solid 1px;
}
>> $('.game-opt')[0].clientHeight
23 (height+paddingTop)
>> $('.game-opt')[0].offsetHeight
25 (height+borderTop+borderBottom+paddingTop)