I have a page with a set of images, each with a unique ID ("Main-1", "Main-2" etc) contained in a white-space:nowrap div
, so the page scrolls horizontally.
I would like a way of cycling through these images using the left and right arrow keys (preferably using a scroll animation, I am currently using scrollTo()
in the currently existing straightforward navigation links).
I have found this for vertically-scrolling websites, but can't seem to find a horizontal equivalent (and my JS isn't great, so my attempts to convert the vertical code to my horizontally scrolling page has failed miserably!).
This JFiddle does exactly what I want, but for a vertically scrolling site: http://jsfiddle.net/aVvQF/4/ ..... can anyone help me convert this to use with horizontal scrolling?
Thanks !