计算DIV自适应的高度问题

在IE下,把一个固定高度的DIV设置自适应(auto)高度后,如何计算自适应后的高度?

clientHeight、scrollHeight、offsetHeight都不对,用Jquery的height()获取,在chrome下是正确的,IE就错了。

阅读 3.5k
1 个回答

I think clientHeight or offsetHeight should work out fine. Maybe the "height" you needed is not the generally-meant height?

Or maybe you can try getBoundingClientRect.

推荐问题