计算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.

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题