https://developer.mozilla.org/en-US/docs/Web/API/element.scrollHeight:
This property will round the value to an integer. If you need a fractional value, use
element.getBoundingClientRect()
.
Except... element.getBoundingClientRect()
does not return the scrollHeight. How would one get a fractional scrollHeight? Is it possible?
I think I might have the solution:
var rect = element.getBoundingClientRect()
var scrollHeight = element.scrollHeight + (parseInt(rect.height) - rect.height)
var scrollWidth = element.scrollWidth + (parseInt(rect.width) - rect.width)