scrollTop is a non-rounded number, while scrollHeight and clientHeight are rounded — so the only way to determine if the scroll area is scrolled to the bottom is by seeing if the scroll amount is close enough to some threshold (in this example 1):
to check an element has been totally scrolled should consider: scrollTop is a non-rounded number, while scrollHeight and clientHeight are rounded, so the consider should be like below:
according MDN scrollHeight document
to check an element has been totally scrolled should consider: scrollTop is a non-rounded number, while scrollHeight and clientHeight are rounded, so the consider should be like below: