Skip to content Skip to sidebar Skip to footer

How To Link Individual Images In Javascript Slideshow?

So I am fairly new to javascript. I would like to add a link to each of the images in this slideshow. There are only two images. I have tried to link them like you would with an &l

Solution 1:

From the original documentation of the imagearray array:

["path_to_image", "optional_url", "optional_linktarget", "optional_description"]

So you need to change the imagearray array to this:

imagearray: [
         ["../Images/slideshow_wakeup.png"], "../Images/slideshow_wakeup.png", "_new", "Some text to describe the image."],
        ["../Images/slideshow_2.png", "../Images/slideshow_2.png", "_new", "Some text to describe the image."],
        <!--["newappvantagemobile.com/images/slideshow_3.png"]-->
         //<--no trailing comma after very last image element!
    ],

I'll explain it. The array has 4 elements.

  1. First one is the address of the image (as you know already).
  2. Second one is the link which will be opened when you click on the image.
  3. Third one specifies how the link will be opened. _new means on a new window/tab
  4. The last parameter is the text which will be shown at the bottom of the image.

Hope this helps.

Post a Comment for "How To Link Individual Images In Javascript Slideshow?"