I’m making custom select boxes and I need a way to programmaticly detect which of several boxes is being scrolled.
I am trying to mimic the <select> functionality when size > 1. That is if you hit [up:38] or [down:40] select the appropriate item in the list.
My fiddle I’m working with http://jsfiddle.net/GtA8v/52/
Now since the event is attached to the body, how do I know which of the ‘.wrap’ elements are being scrolled(hopefully before they are scrolled so I can actually stop the event if needs be)?
EDIT: I updated the Jfiddle if you look I just have place holder for which ‘wrap’ is being scrolled once I can figure out which ‘wrap is received the event it will work as I expect.
UUUUUGGGGGLLLLLYYY but it works, I make note of when a wrap element is focused and then when the selectNext() function is called I just reference that. I’ll leave this as the unaccepted answer for a while, to see if someone knows how to establish this from looking at the event object, but this is a solution that works.
http://jsfiddle.net/GtA8v/66/