Click to See Complete Forum and Search --> : Jump to an item in a CSS scroll box


potterd64
03-13-2007, 04:27 PM
I have a long list of items that I've stick into a scrollable div space using overflow:auto. I was wondering if there was a way to jump to a spot in that list when the user clicks something outside of the list? The effect I'm going for is much like those pages where you click a link and it just makes the window jump down to somewhere further on in the page. I would like to do that, but have the scrollable div area auto jump.

potterd64
03-13-2007, 04:41 PM
I guess I shouldn't have posted such an easy problem.
If anyone's interested, I just found that you can simply grab the element in the list that you want to jump to and call focus() on it. I think you can only focus on certain elements, so I used an anchor tag to focus on. It might not work if you try focusing on a table row or something.