I'm not talking about getting a rounded size, I need to get the fractional one.
An only way I know is to create a new div
element with the position: fixed; top: 0; right: 0, bottom: 0, left: 0
properties set and append it to the body
element after it's done, I can get a fractional size with getBoundingClientRect
.
But it's slow, it's very slow. This approach stops the rest JS code from being executed until the DOM manipulations and calculations are done.
Is there a way of doing this without an expensive approach?