I have a simple question that I haven't been able to find a clear answer to. What I'm trying to do is calculate 20% of the total scrollHeight and subtract it from the total scroll height.
This is the code I am using:
In my condition, I check if the sum of
ev.target.offsetHeight + ev.target.scrollTop
is greater than or equal to ev.target.scrollHeight - (parseFloat(ev.target.scrolllHeight).toFixed(2) * 0.2)
. If it is, then I do something inside the condition.
The error message says that toFixed is not a function because the left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
I attempted to use
parseFloat((ev.target.scrolllHeight: number)).toFixed(2)
, but it did not work.
If anyone can provide some guidance, I would greatly appreciate it. Thank you in advance.