Hey there! I finally cracked the code on how to prevent chat scrolling when a user scrolls up to read, and then resume scrolling once they reach the bottom.
However, I've encountered a hitch - the chat adds an extra 17px when I set a size for each post. No matter what size I specify, that pesky 17px stays put.
Here's a snippet of my code:
scrollTop + divHeight : scrollHeight : amountOfPosts
809 : 792 : 11
881 : 864 : 12
You'll notice that scrollTop + height exceeds the scrollHeight by just 17px. So, where are these mysterious 17px coming from? I need to identify the culprit responsible for adding them so I can adjust my chat dynamically instead of manually.
Check out this live jsfiddle example: http://jsfiddle.net/Yp33R/