Usually when I insert an element into DOM, the page will not automatically scroll. For example, at first there are divs A
B
D
on page, and the browser view is on D
.
A
B
D ] <= browser view
Then I insert C
between B
and D
. The browser view now is on C
.
A
B
C ] <= browser view
D
But I hope it on D. How could I make browser automatically scroll when inserting elements by javascript(but users can still scroll freely)?