[英]jquery: scroll with specific DOM
Usually when I insert an element into DOM, the page will not automatically scroll. 通常,当我将元素插入DOM时,页面不会自动滚动。 For example, at first there are divs A
B
D
on page, and the browser view is on D
. 例如,首先页面上有div A
B
D
,浏览器视图在D
。
A
B
D ] <= browser view
Then I insert C
between B
and D
. 然后我在B
和D
之间插入C
The browser view now is on C
. 现在,浏览器视图位于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)? 但是我希望它在D上。当使用javascript插入元素时,如何使浏览器自动滚动(但用户仍然可以自由滚动)?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.