You're pretty close using scrollTop == scrollHeight
.
scrollTop
refers to the top of the scroll position, which will be scrollHeight - offsetHeight
Your if statement should look like so (don't forget to use triple equals):
if( obj.scrollTop === (obj.scrollHeight - obj.offsetHeight))
{
}
Edit: Corrected my answer, was completely wrong
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…