I need to know, if it’s possible to vertically center a selected item of a select list (with javascript):

My approaches
First, I tried to select the item and then just scroll the list. But this isn’t possible as I found out via google. The only way to change the vertical scroll is to select an item.
So the second approach was to select an item which has an index plus 3. So the list would scroll down to this item. After that, I selected the “real” index.
But it doesn’t work, because the item will always been selected at the bottom.
Question
And now I’m here and would like to ask, if it’s possible to get the selected list item into the middle of the list?
And how it would be done 😉
Regards Florian
Because a drop-down list is browser-handled and can’t be manipulated very well, you have to recreate the behavior of a drop-down list yourself.
Nested divs should work with
overflow: scroll;.Then, you can use any scrollTo solution javascript has.