Automatically scroll down chat div
Let’s review a few useful concepts about scrolling first: scrollHeight: total container size. scrollTop: amount of scroll user has done. clientHeight: amount of container a user sees. When should you scroll? User has loaded messages for the first time. New messages have arrived and you are at the bottom of the scroll (you don’t want … Read more