DIV auto scroll

后端 未结 5 1040
情话喂你
情话喂你 2021-02-06 10:34

I have a div that has a large number of items in it. I select these items dynamically by clicking a button, overflow is auto in my case. What I want is that when an item that is

5条回答
  •  情话喂你
    2021-02-06 11:24

    You could also use the DIV's scrollTop or scrollLeft property (depending on if the scroll is horizontal or vertical).

    I've done this before and used a setTimeout event to make it scroll fluidly, rather than in 1 motion. This is without JQuery tho.

提交回复
热议问题