I have div with tree view inside. Div is smaller than tree so on the right side I have vertical scroll bar. When users press some button outside the div, I want to scroll to specified item inside div (I know ID of that item).
How to scroll vertical scroll bar? How to focus on some element?
I think you can do it in two stages:
First, get the position of your element in the div with jQuery function
.scrollTop().Then, set the scrolling position of your div :
$(yourdiv).scrollTop(yourElementPosition)Here is the official documentation for the function .scrollTop()