Is there a way to set the default scroll of an element to the max always so when you append new element to it it will scroll by default to the max like this
#elmnt{
default-scroll:max;
}
Is there a way to set the default scroll of an element to the max always so when you append new element to it it will scroll by default to the max like this
#elmnt{
default-scroll:max;
}
2
Answers
You will have to manually scroll to the bottom after the element has been appended.
Check this here
If you’re inserting child elements into a parent container (like i.e: chat messages into a chat window), simply use Element.scrollTo(options)
Example:
another suggestion: by using Element.scrollIntoView() on the added child element.
Example:
Notice in the last example how every ancestor is scrolled in order for the message to get into view.