So I have this simple slideshow:
-
See the answer in action http://jsfiddle.net/7LhLsh7L/ (note for fiddler: as it runs in editor itself before pressing arrow(left, right) keys, you should give focus(just click result area) to result area)
Here is the markup and script:
The features of above solution:
- If you click on the image, it'll take you to next image and repeats the cycle when it reaches last image.
- For Left arrow(<-) it loads previous image and cycles repeats in reverse direction when reaches first image.
- Right arrow(->) behavior is similar to click.