Fast alternatives for `element.clientHeight` and `element.offsetHeight`

别来无恙 提交于 2021-02-11 14:23:39

问题


I need the element.clientHeight and element.offsetHeight of an HTMLElement, but calculating it is very slow, and especially, it takes for about 3 seconds my long element that we can scroll on! Is there a fast alternative to these two?

getBoundingClientRect() does not work and it has the same performance.

Similar question: text editor in textarea SLOW - javascript It seems for the elements doesn't automatically grow, this calculation is very slow.

来源:https://stackoverflow.com/questions/63065048/fast-alternatives-for-element-clientheight-and-element-offsetheight

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!