I am having a difficult time trying to find my answer on my own, so maybe someone can help.
I have a horizontal scrolling div (wrapper) with mutliple divs (box) inside of it.
I want to be able to click the keyboard arrows keys to jump to the next element. The window would be scrolling left with each jump.
I’ve created a basic jsFiddle that people can add too to add keyboard navigation.
This can be accomplished by storing the positions of the boxes and then testing that against the
window.scrollXposition. You then animate to the closest box depending on the arrow key pressed.See Demo