0

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)?

4

1 回答 1

0

如果您使用jquerythen 在新 DOM 时触发特定 DOM 元素的滚动;C添加。

于 2013-02-10T20:57:00.293 回答