How to create a clickable slide show
The slideshow we've just created is almost identical to the one in the beginning of this tutorial, except that its not clickable. We will now see how to extend this example to enable it to not only be "hyperlinked", but hyperlinked with a different url, depending on the image displayed.
A slideshow that's not clickable is essentially the same as a fancy animated gif. A slideshow that is, however, becomes an interactive billboard. In this section, we will enhance the old slideshow to make it into just that!
Don't panic- the road to interactivity does not require us to alter the original code, just add to it. All that's needed is the addition of a <a> tag surrounding the <img> tag, and a function that manipulates this <a> tag to match different links to each image in the slideshow.
Notice the code
document. In the above case, the function that will be executed is
Step 2: Declare and implement function
In this tutorial, we've created a slideshow that cycles through three images; it could easily be modified to accommodate any number of images.