问题
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