How js/jquery controls the scroll bar

clipboard.png
function is very simple, as shown in the figure, it is controlled up and down by the keyboard. Now there are 10 pieces of data (visual range) in the div. When you control the keyboard and go to the 11th piece of data, you should set the offset of div scrollTop. How to get this offset?

Mar.10,2021

can be obtained directly through the scrollTop attribute of the container DOM element


[jquery operation scroll bar scrolls to the specified location [with online instance]] [1]

this is the most complete article I have ever read about the scroll bar of jquery operation http://www.aijquery.cn/Html/j.

Menu