Hello. I write here a script for a custom scrollbar. There is a problem.
If the height of the list is not very large, but there is a large amount of text in the scrolling area, the height of the scrollbar will be very small.
An example can be found here <---
I tried to increase it with some kind of multiplier.
this.scroll.style.height = this.scrollWrap.clientHeight * container.clientHeight / container.scrollHeight * 10 +'px'; But in this case, when scrolling to the bottom, the scroll takes a wrong position. I can not understand how to calculate the coefficient for scrolling positioning. The one that this.scroll.style.top
Tell me how to properly implement.