Skip to content
Advertisement

Scroll to bottom of div?

I am creating a chat using Ajax requests and I’m trying to get messages div to scroll to the bottom without much luck.

I am wrapping everything in this div:

JavaScript

Is there a way to keep it scrolled to the bottom by default using JS?

Is there a way to keep it scrolled to the bottom after an ajax request?

Advertisement

Answer

Here’s what I use on my site:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement