I have a div container set to overflow:auto which contains many <li>‘s. I wrote a simple function to change the highlighted list-item when the user clicks a button or presses the up or down arrows.
The only problem is when the user clicks the iteration button the highlighted list-item iterates without the container scrollbar following it. I’m looking for a way to force the container scrollbar to scroll with the iteration
here is an example of what I’m trying to do:
http://jsfiddle.net/sadmicrowave/rwfUr/
Remember – up and down arrows make the container scroll (as long as the container has focus) but the iteration button does not.
Important – I am looking for an alternative to .scrollTo()
What about .scrollIntoView() ?