D
D
danyadev2018-12-04 18:53:55
JavaScript
danyadev, 2018-12-04 18:53:55

How to automatically scroll down when adding content to a wrap?

I have a wrap, inside of which there are other elements, and if the scroll is already at the very bottom, it is necessary that when adding an element, the scroll is again at the very bottom and this new element is visible, like messages in VK.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Ineshin, 2018-12-04
@danyadev

Element.scrollIntoView()

A
Anton Anton, 2018-12-04
@Fragster

My bike:
This is when adding from above:
https://jsfiddle.net/n0rmt92o/99/
and this is one of the options when adding from below:
https://jsfiddle.net/n0rmt92o/29/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question